From c4e687fa899f586cd66f476c2c81f218a10b131f Mon Sep 17 00:00:00 2001 From: Michael Leaney Date: Thu, 1 Aug 2019 12:26:11 +0800 Subject: [PATCH] Only remove target from webpack config --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 53bf95d..ea5c34c 100644 --- a/index.js +++ b/index.js @@ -15,11 +15,11 @@ module.exports = (api, projectOptions) => { } }, (args, rawArgv) => { - let webpackConfigForTests = api.resolveChainableWebpackConfig() - .target() - .clear() + api.chainWebpack((chain) => { + chain.delete('target'); + }); - webpackConfigForTests = webpackConfigForTests.toConfig() + webpackConfigForTests = api.resolveWebpackConfig(); // workaround for: https://github.com/webpack-contrib/karma-webpack/pull/325 // TODO: remove this when the above PR is merged