fix(webpack): clone config.entry (fixes #4849) (#5236)

This commit is contained in:
Julien Dargelos 2019-03-14 11:05:19 +01:00 committed by Pooya Parsa
parent b22d97ea3a
commit 821676511b
2 changed files with 4 additions and 4 deletions

View File

@ -182,9 +182,9 @@ export default class WebpackClientConfig extends WebpackBaseConfig {
`${querystring.stringify(hotMiddlewareClientOptions)}&path=${clientPath}`.replace(/\/\//g, '/') `${querystring.stringify(hotMiddlewareClientOptions)}&path=${clientPath}`.replace(/\/\//g, '/')
// Entry points // Entry points
config.entry = { config.entry = Object.assign({}, config.entry, {
app: [path.resolve(buildDir, 'client.js')] app: [path.resolve(buildDir, 'client.js')]
} })
// Add HMR support // Add HMR support
if (this.dev) { if (this.dev) {

View File

@ -69,9 +69,9 @@ export default class WebpackServerConfig extends WebpackBaseConfig {
Object.assign(config, { Object.assign(config, {
target: 'node', target: 'node',
node: false, node: false,
entry: { entry: Object.assign({}, config.entry, {
app: [path.resolve(this.buildContext.options.buildDir, 'server.js')] app: [path.resolve(this.buildContext.options.buildDir, 'server.js')]
}, }),
output: Object.assign({}, config.output, { output: Object.assign({}, config.output, {
filename: 'server.js', filename: 'server.js',
libraryTarget: 'commonjs2' libraryTarget: 'commonjs2'