-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (41 loc) · 1.18 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');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpack = require('webpack');
module.exports = {
entry: {
demo: './src/demo.js',
demo2: './src/demo2.js'
},
output: {
path: path.join(__dirname, '/public'),
filename: '[name].js',
chunkFilename: '[id].js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
include: [
path.resolve(__dirname, './src')
],
query: {
presets: ['es2015', 'react']
}
},
{
test: /.(png|woff(2)?|eot|ttf|svg|jpg)(\?[a-z0-9=\.]+)?$/,
loader: 'url-loader?limit=100000'
}, {
test: /\.(scss|css)?$/,
loader: ExtractTextPlugin.extract("css!sass"),
include: [
path.resolve(__dirname, './src')
]
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin("commons", "commons.js"),
new ExtractTextPlugin("[name].css")
]
};