-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
39 lines (38 loc) · 1.08 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
var path = require('path');
var webpack = require('webpack');
var entries = [];
var loaders = [];
var plugins = [];
if (/production/.test(process.env.NODE_ENV)) {
plugins = [ new webpack.optimize.UglifyJsPlugin() ];
}
else {
entries = [ 'webpack-dev-server/client?http://localhost:8888', 'webpack/hot/dev-server' ];
loaders = [ { loader: 'react-hot', exclude: /node_modules/ } ]
plugins = [ new webpack.HotModuleReplacementPlugin() ];
}
module.exports = {
entry: entries.concat([
'./main.js',
'./js/jquery-ui-1.12.1.custom.min.js',
'./js/jquery.hoverIntent.js',
'./js/bootstrap/dropdown.js',
'./js/phantomjs-shims.js',
'./js/console-polyfill.js',
]),
output: {
path: __dirname + '/js/',
filename: 'deps.js',
publicPath: '/js/'
},
plugins: plugins,
module: {
loaders: loaders.concat([
{ test: /\.jsx?$/, loader: 'babel?stage=0', exclude: /node_modules/ },
{ test: /\.json$/, loader: 'json' }
])
},
devServer: {
disableHostCheck: true
},
}