From 06ddfbb77b0be63a433b3c5e7581292f5b8be161 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 30 Nov 2018 23:52:53 +0330 Subject: [PATCH] fix(webpack): deepClone before calling extendConfig (#4464) --- packages/webpack/src/config/base.js | 4 +--- test/unit/basic.dev.test.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/webpack/src/config/base.js b/packages/webpack/src/config/base.js index 46bbf28d84..f414cca38a 100644 --- a/packages/webpack/src/config/base.js +++ b/packages/webpack/src/config/base.js @@ -361,9 +361,7 @@ export default class WebpackBaseConfig { plugins: this.plugins() } - const extendedConfig = this.extendConfig(config) - // Clone deep avoid leaking config between Client and Server - return cloneDeep(extendedConfig) + return this.extendConfig(cloneDeep(config)) } } diff --git a/test/unit/basic.dev.test.js b/test/unit/basic.dev.test.js index 9c977154d9..667aa4044d 100644 --- a/test/unit/basic.dev.test.js +++ b/test/unit/basic.dev.test.js @@ -87,7 +87,7 @@ describe('basic dev', () => { ) const { cssModules, vue } = loadersOptions expect(cssModules.localIdentName).toBe('[hash:base64:6]') - expect(vueLoader.options).toBe(vue) + expect(vueLoader.options).toEqual(vue) }) test('Config: cssnano is at then end of postcss plugins', () => {