-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
36 lines (33 loc) · 915 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var webpackDevHost = 'localhost';
module.exports = function(webpackDevPort) {
return {
entry: [
'webpack-dev-server/client?http://' + webpackDevHost + ':' + webpackDevPort,
'webpack/hot/only-dev-server',
'./components/index'
],
cache: true,
debug: true,
devtool: 'eval-cheap-module-source-map',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: 'http://' + webpackDevHost + ':' + webpackDevPort + '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{test: /\.jsx?$/, loaders: ['jsx-loader?insertPragma'] },
{ test: /\.es$/, loaders: ['babel?optional=runtime'] },
{ test: /\.css$/, loaders: ['style-loader', 'css-loader'] }
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.es', '.css']
},
}
}