-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
52 lines (51 loc) · 1.91 KB
/
Copy pathwebpack.dev.config.js
File metadata and controls
52 lines (51 loc) · 1.91 KB
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
50
51
52
var path = require('path');
var webpack = require('webpack');
/**
* @summary This file configures Webpack for our development environment, including some other useful features.
* The key differences are that we include the devServer key, along with options to specify where the content should
* be loaded from (contentBase) and hosted at (publicPath). We include the "HotModuleReplacementPlugin()" to manage
* the automatic file watching and bundle updating. We also add the "webpack-hot-middleware"
* @type {{entry: string[], output: {filename: string, path: string, publicPath: string}, devServer: {inline: boolean, hot: boolean, publicPath: string, contentBase: string}, plugins: *[], module: {loaders: *[]}, node: {console: boolean, fs: string, net: string, tls: string}}}
*/
module.exports = {
entry : ['./react/main.js', 'webpack-hot-middleware/client', 'webpack/hot/dev-server'],
output : {
filename : 'bundle.js',
path : '/',
publicPath : '/js/'
},
devServer : {
inline : true,
hot : true,
publicPath : '/public',
contentBase : './public'
},
plugins : [
new webpack.HotModuleReplacementPlugin()
],
module : {
loaders : [
{
test : /.jsx?$/,
loader : 'babel-loader',
exclude : /node_modules/,
query : {
presets : ['es2015', 'react', 'react-hmre']
}
},
{ test : /\.css$/, loader : 'css-loader' },
{ test: /\.(svg|ttf|woff|eot|woff2)(\?.*)?$/, loader: 'file' },
{ test : /\.json$/, loader: 'json'},
{
test: /\.(jpg|png)$/,
loader: 'url?limit=25000',
include: __dirname+'/public/assets'
}
]
}, node: {
console: true,
fs: 'empty',
net: 'empty',
tls: 'empty'
}
};