-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (44 loc) · 1.16 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
var path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const mainStylesExtract = new ExtractTextPlugin('main.css');
const EXCLUDES = [/node_modules/];
module.exports = {
context: path.resolve('src'),
entry: {
main: './js/main'
},
output: {
path: path.resolve('build/'),
publicPath: '/build',
filename: '[name].js'
},
devServer: {
contentBase: 'src'
},
plugins: [
mainStylesExtract
],
module: {
loaders: [{ // Javascript
test: /\.js$/,
exclude: EXCLUDES,
loader: 'babel-loader'
}, { // Sass
test: /main\.scss$/,
exclude: EXCLUDES,
loader: mainStylesExtract.extract({
fallback: 'style-loader',
use: [{
loader: 'css-loader'
}, {
loader: 'autoprefixer-loader'
}, {
loader: 'sass-loader',
options: {
includePaths: ['./node_modules']
}
}]
})
}]
}
};