From 88f98fb61de9aa20ff188dec9bebe16101ebc520 Mon Sep 17 00:00:00 2001 From: Sebastien Chopin Date: Tue, 22 Aug 2017 13:56:22 +0200 Subject: [PATCH] Don't call extend for server if spa mode --- lib/builder/builder.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 0982b3b7df..970d77ed2a 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -365,8 +365,9 @@ export default class Builder extends Tapable { compilersOptions.push(clientConfig) // Server - const serverConfig = serverWebpackConfig.call(this) + let serverConfig = null if (this.options.build.ssr) { + serverConfig = serverWebpackConfig.call(this) compilersOptions.push(serverConfig) } @@ -380,7 +381,7 @@ export default class Builder extends Tapable { } // Server config - if (!serverConfig.resolve.alias[p.name]) { + if (serverConfig && !serverConfig.resolve.alias[p.name]) { // Alias to noop for ssr:false plugins serverConfig.resolve.alias[p.name] = p.ssr ? src : './empty.js' }