-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
52 lines (50 loc) · 1.15 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
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require('path');
const sassLoaders = [
'css-loader',
'postcss-loader',
`sass-loader?includePaths[]=${path.resolve(__dirname, './src/styles')}`
];
module.exports = {
entry: './src/main.js',
output: {
path: './public/js',
filename: 'bundle.js',
sourceMapFilename: '[file].map'
},
module: {
loaders: [
{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: [
'es2015',
'react'
],
plugins: [
'syntax-class-properties',
'transform-class-properties',
'syntax-decorators',
'transform-decorators-legacy',
'transform-object-rest-spread'
]
}
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style-loader', sassLoaders.join('!'))
}
]
},
devtool: '#source-map',
plugins: [
new ExtractTextPlugin('../css/bundle.css', {
allChunks: true
})
],
postcss() {
return [require('autoprefixer')];
}
};