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('react-hot-loader/patch');
20 sources[i].push('webpack-dev-server/client?http://localhost:' + devPort);
21 sources[i].push('webpack/hot/only-dev-server');
27 let webpackDevConfig = Object.assign({}, webpackCommon, {
28 entry: getEntrySources(devConfig.bundles),
29 devtool: 'eval-source-map',
31 path: path.join(__dirname, 'dist'),
32 publicPath: `http://localhost:${devPort}/onboarding/`,
37 historyApiFallback: true,
38 publicPath: `http://localhost:${devPort}/onboarding/`,
39 contentBase: path.join(__dirname, 'dist'),
44 exclude: ['node_modules']
49 new webpack.DefinePlugin({
53 new webpack.HotModuleReplacementPlugin(),
54 new webpack.LoaderOptionsPlugin({
57 configFile: './.eslintrc',
67 module.exports = webpackDevConfig;