-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (39 loc) · 1.14 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
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: [
'./src/index'
],
output: {
path: path.join(__dirname, 'static'),
publicPath: '/static/',
filename: 'bundle.js'
},
/* TODO (for production)
new webpack.optimize.UglifyJsPlugin()
new webpack.optimize.DedupePlugin()
add [hash] to enable long term caching.
*/
module: {
loaders: [
{test: /\.less$/, loader: 'style!css!less'},
{test: /\.css$/, loader: 'style!css!'},
{test: /\.(png|jpg)$/, loader: 'url-loader?limit=10000'},
{
test: /\.js$/,
include: path.join(__dirname, 'src'),
loader: 'babel',
query: {
presets: ['react']
}
}
]
},
// These are dependencies (e.g.: `require('react');`) in your project that
// are not included in the output file (`bundle.js`) as you should
// link to them directly via a CDN, or something.
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
}
};