forked from codecombat/codecombat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.development.config.js
30 lines (28 loc) · 1.09 KB
/
webpack.development.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
// Use this webpack config for development, with `webpack --config webpack.development.config.js`
// process.traceDeprecation = true;
const webpack = require('webpack');
const _ = require('lodash');
const LiveReloadPlugin = require('webpack-livereload-plugin');
const baseConfigFn = require('./webpack.base.config')
// Development webpack config
module.exports = (env) => {
if (!env) env = {};
const baseConfig = baseConfigFn(env);
const plugins = [
new webpack.BannerPlugin({ // Label each module in the output bundle
banner: "hash:[hash], chunkhash:[chunkhash], name:[name], filebase:[filebase], query:[query], file:[file]"
}),
new LiveReloadPlugin({ // Reload the page upon rebuild
appendScriptTag: true,
port: process.env.WEBPACK_LIVE_RELOAD_PORT || 35432
}),
];
return _.merge(baseConfig, {
output: _.merge({}, baseConfig.output, {
chunkFilename: 'javascripts/chunks/[name].bundle.js',
}),
devtool: 'eval-source-map', // https://webpack.js.org/configuration/devtool/
plugins: baseConfig.plugins.concat(plugins),
mode: 'development'
})
}