3 const path = require('path');
4 const webpack = require('webpack');
5 const proxyServer = require('./proxy-server');
7 let localDevConfig = {};
9 localDevConfig = require('./devConfig');
11 let devConfig = Object.assign({}, require('./devConfig.defaults'), localDevConfig);
12 let devPort = process.env.PORT || devConfig.port;
14 let webpackCommon = require('./webpack.common');
16 function getEntrySources(sources) {
17 for (let i in sources) {
18 if (sources.hasOwnProperty(i)) {
19 sources[i].push('webpack-dev-server/client?http://localhost:' + devPort);
20 sources[i].push('webpack/hot/only-dev-server');
26 let webpackDevConfig = Object.assign({}, webpackCommon, {
27 entry: getEntrySources(devConfig.bundles),
28 devtool: 'eval-source-map',
30 path: path.join(__dirname, 'dist'),
31 publicPath: `http://localhost:${devPort}/onboarding/`,
36 historyApiFallback: true,
37 publicPath: `http://localhost:${devPort}/onboarding/`,
38 contentBase: path.join(__dirname, 'dist'),
43 exclude: ['node_modules']
48 new webpack.DefinePlugin({
52 new webpack.HotModuleReplacementPlugin(),
53 new webpack.LoaderOptionsPlugin({
56 configFile: './.eslintrc',
66 module.exports = webpackDevConfig;