-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.dev.js
51 lines (50 loc) · 1.21 KB
/
webpack.config.dev.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
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
resolve: {
root: [path.join(__dirname, 'src')],
modulesDirectories: ['node_modules', 'src', 'scss'],
alias: {
'react': path.resolve('./node_modules/react'),
'react-dom': path.resolve('./node_modules/react-dom')
}
},
entry: {
app: './src/app.js',
vendors: ['react', 'react-dom']
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: 'dist/'
},
devtool: '#source-map',
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-0']
}
},
{
test: /\.(scss|css)$/,
loader: ExtractTextPlugin.extract('style', 'css!sass')
},
{
test: /\.less$/,
loader: 'style-loader!css-loader!less-loader'
},
{
test: /\.(ttf|eot|png|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file-loader'
}
]
},
plugins: [
new ExtractTextPlugin("style.css"),
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js')
]
};