-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
66 lines (64 loc) · 1.92 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const path = require('path');
const webpack = require('webpack');
//const DashboardPlugin = require('webpack-dashboard/plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
// const extractCommons = new webpack.optimize.CommonsChunkPlugin({
// name: 'commons',
// filename: 'commons.js'
// })
const config = {
context: path.resolve(__dirname),
entry: {
main: './public/main.js'
},
output: {
path: path.resolve(__dirname),
filename: './public/dist/[name].bundle.js'
},
module: {
rules: [{
test: /\.js$/,
include: path.resolve(__dirname, 'public'),
use: [{
loader: 'babel-loader',
options: {
presets: [
['es2015', { modules: false }]
]
}
}]
}, {
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader',
{
loader: 'postcss-loader?sourceMap=false',
options: {
plugins: function() {
return [
require('precss'),
require('autoprefixer')
];
}
}
},
'sass-loader'
],
})
}, {
test: /\.(png|jpg)$/,
use: [{
loader: 'url-loader',
options: { limit: 10000 } // Convert images < 10k to base64 strings
}]
}]
},
plugins: [
//new DashboardPlugin(),
new ExtractTextPlugin("./public/dist/styles.css")
]
}
process.noDeprecation = true;
module.exports = config;