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.js27
1 files changed, 23 insertions, 4 deletions
diff --git a/client/config/webpack.dev.js b/client/config/webpack.dev.js
index 50193bf58..fede16932 100644
--- a/client/config/webpack.dev.js
+++ b/client/config/webpack.dev.js
@@ -6,15 +6,18 @@ const commonConfig = require('./webpack.common.js') // the settings that are com
6 * Webpack Plugins 6 * Webpack Plugins
7 */ 7 */
8const DefinePlugin = require('webpack/lib/DefinePlugin') 8const DefinePlugin = require('webpack/lib/DefinePlugin')
9const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin')
9 10
10/** 11/**
11 * Webpack Constants 12 * Webpack Constants
12 */ 13 */
13const ENV = process.env.ENV = process.env.NODE_ENV = 'development' 14const ENV = process.env.ENV = process.env.NODE_ENV = 'development'
15const HOST = process.env.HOST || 'localhost'
16const PORT = process.env.PORT || 3000
14const HMR = helpers.hasProcessFlag('hot') 17const HMR = helpers.hasProcessFlag('hot')
15const METADATA = webpackMerge(commonConfig.metadata, { 18const METADATA = webpackMerge(commonConfig.metadata, {
16 host: 'localhost', 19 host: HOST,
17 port: 3000, 20 port: PORT,
18 ENV: ENV, 21 ENV: ENV,
19 HMR: HMR 22 HMR: HMR
20}) 23})
@@ -81,7 +84,10 @@ module.exports = webpackMerge(commonConfig, {
81 * 84 *
82 * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename 85 * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
83 */ 86 */
84 chunkFilename: '[id].chunk.js' 87 chunkFilename: '[id].chunk.js',
88
89 library: 'ac_[name]',
90 libraryTarget: 'var'
85 91
86 }, 92 },
87 93
@@ -109,7 +115,9 @@ module.exports = webpackMerge(commonConfig, {
109 'NODE_ENV': JSON.stringify(METADATA.ENV), 115 'NODE_ENV': JSON.stringify(METADATA.ENV),
110 'HMR': METADATA.HMR 116 'HMR': METADATA.HMR
111 } 117 }
112 }) 118 }),
119
120 new NamedModulesPlugin()
113 ], 121 ],
114 122
115 /** 123 /**
@@ -124,6 +132,17 @@ module.exports = webpackMerge(commonConfig, {
124 resourcePath: 'src' 132 resourcePath: 'src'
125 }, 133 },
126 134
135 devServer: {
136 port: METADATA.port,
137 host: METADATA.host,
138 historyApiFallback: true,
139 watchOptions: {
140 aggregateTimeout: 300,
141 poll: 1000
142 },
143 outputPath: helpers.root('dist')
144 },
145
127 /* 146 /*
128 * Include polyfills or mocks for various node stuff 147 * Include polyfills or mocks for various node stuff
129 * Description: Node configuration 148 * Description: Node configuration