-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
40 lines (39 loc) · 1 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
var webpack = require('webpack');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['react-hot', 'jsx?harmony'],
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', ['es2015', { 'loose': true }], 'stage-1']
}
}]
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './'
},
externals: {
env_config: JSON.stringify(process.env.ENV === 'production'
? require('./env_config/config.prod.json')
: require('./env_config/config.dev.json'))
}
};