Don't call extend for server if spa mode

This commit is contained in:
Sebastien Chopin 2017-08-22 13:56:22 +02:00
parent ef4cdd4776
commit 88f98fb61d

View File

@ -365,8 +365,9 @@ export default class Builder extends Tapable {
compilersOptions.push(clientConfig) compilersOptions.push(clientConfig)
// Server // Server
const serverConfig = serverWebpackConfig.call(this) let serverConfig = null
if (this.options.build.ssr) { if (this.options.build.ssr) {
serverConfig = serverWebpackConfig.call(this)
compilersOptions.push(serverConfig) compilersOptions.push(serverConfig)
} }
@ -380,7 +381,7 @@ export default class Builder extends Tapable {
} }
// Server config // Server config
if (!serverConfig.resolve.alias[p.name]) { if (serverConfig && !serverConfig.resolve.alias[p.name]) {
// Alias to noop for ssr:false plugins // Alias to noop for ssr:false plugins
serverConfig.resolve.alias[p.name] = p.ssr ? src : './empty.js' serverConfig.resolve.alias[p.name] = p.ssr ? src : './empty.js'
} }