aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/config/webpack.dev.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/config/webpack.dev.js')
-rw-r--r--client/config/webpack.dev.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/client/config/webpack.dev.js b/client/config/webpack.dev.js
index 9cf09db0f..8948af9b2 100644
--- a/client/config/webpack.dev.js
+++ b/client/config/webpack.dev.js
@@ -11,6 +11,7 @@ const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin')
11const DefinePlugin = require('webpack/lib/DefinePlugin') 11const DefinePlugin = require('webpack/lib/DefinePlugin')
12const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin') 12const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin')
13const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') 13const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
14const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin')
14 15
15/** 16/**
16 * Webpack Constants 17 * Webpack Constants
@@ -18,14 +19,18 @@ const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
18const ENV = process.env.ENV = process.env.NODE_ENV = 'development' 19const ENV = process.env.ENV = process.env.NODE_ENV = 'development'
19const HOST = process.env.HOST || 'localhost' 20const HOST = process.env.HOST || 'localhost'
20const PORT = process.env.PORT || 3000 21const PORT = process.env.PORT || 3000
22const PUBLIC = process.env.PUBLIC_DEV || HOST + ':' + PORT
23const AOT = process.env.BUILD_AOT || helpers.hasNpmFlag('aot')
21const HMR = helpers.hasProcessFlag('hot') 24const HMR = helpers.hasProcessFlag('hot')
22const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, { 25const METADATA = {
23 host: HOST, 26 host: HOST,
24 port: PORT, 27 port: PORT,
28 public: PUBLIC,
25 ENV: ENV, 29 ENV: ENV,
26 HMR: HMR, 30 HMR: HMR,
31 AOT: AOT,
27 API_URL: 'http://localhost:9000' 32 API_URL: 'http://localhost:9000'
28}) 33}
29 34
30const DllBundlesPlugin = require('webpack-dll-bundles-plugin').DllBundlesPlugin 35const DllBundlesPlugin = require('webpack-dll-bundles-plugin').DllBundlesPlugin
31 36
@@ -125,11 +130,9 @@ module.exports = function (env) {
125 'HMR': METADATA.HMR, 130 'HMR': METADATA.HMR,
126 'API_URL': JSON.stringify(METADATA.API_URL), 131 'API_URL': JSON.stringify(METADATA.API_URL),
127 'process.version': JSON.stringify(process.version), 132 'process.version': JSON.stringify(process.version),
128 'process.env': { 133 'process.env.ENV': JSON.stringify(METADATA.ENV),
129 'ENV': JSON.stringify(METADATA.ENV), 134 'process.env.NODE_ENV': JSON.stringify(METADATA.ENV),
130 'NODE_ENV': JSON.stringify(METADATA.ENV), 135 'process.env.HMR': METADATA.HMR
131 'HMR': METADATA.HMR
132 }
133 }), 136 }),
134 137
135 new DllBundlesPlugin({ 138 new DllBundlesPlugin({
@@ -216,8 +219,9 @@ module.exports = function (env) {
216 } 219 }
217 220
218 } 221 }
219 }) 222 }),
220 223
224 new HotModuleReplacementPlugin()
221 ], 225 ],
222 226
223 /** 227 /**
@@ -232,6 +236,7 @@ module.exports = function (env) {
232 port: METADATA.port, 236 port: METADATA.port,
233 host: METADATA.host, 237 host: METADATA.host,
234 historyApiFallback: true, 238 historyApiFallback: true,
239 hot: METADATA.HMR,
235 watchOptions: { 240 watchOptions: {
236 ignored: /node_modules/ 241 ignored: /node_modules/
237 } 242 }