-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
74 lines (65 loc) · 1.89 KB
/
webpack.config.dev.js
File metadata and controls
74 lines (65 loc) · 1.89 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
var path = require('path')
var webpack = require('webpack')
var Dashboard = require('webpack-dashboard')
var DashboardPlugin = require('webpack-dashboard/plugin')
var dashboard = new Dashboard()
module.exports = {
// The base directory for resolving the entry option
context: __dirname,
devtool: 'eval',
entry: {
app: ['webpack-dev-server/client?http://0.0.0.0:3000',
'webpack/hot/only-dev-server',
'react-hot-loader/patch',
'index.hot'],
vendor: ['react',
'react-dom']
},
// Various output options, to give us a single bundle.js file with everything resolved and concatenated
output: {
path: path.join(__dirname, '/dist'),
publicPath: '/assets/',
filename: '{{PKG_NAME}}.dev.js',
pathinfo: true
},
// Where to resolve our loaders
resolveLoader: {
modules: [path.join(__dirname, 'node_modules')],
moduleExtensions: ['-loader'],
},
resolve: {
// Directories that contain our modules
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
descriptionFiles: ['package.json'],
moduleExtensions: ['-loader'],
// Extensions used to resolve modules
extensions: ['.js', '.react.js']
},
module: {
rules: [
{
test: /\.js$/,
use: [
'babel',
'react-hot-loader/webpack'
],
exclude: [/node_modules/]
},
],
},
plugins: [
new webpack.DefinePlugin({'process.env': {NODE_ENV: '"development"'}}),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.CommonsChunkPlugin({names: ['client', 'vendor'],
filename: 'vendor.dev.js'}),
new DashboardPlugin(dashboard.setData),
],
// Include mocks for when node.js specific modules may be required
node: {
fs: 'empty',
vm: 'empty',
net: 'empty',
tls: 'empty'
}
};