From 88eec7c7ac43980946f7873cd5a80472369c8a39 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Wed, 29 May 2019 17:06:56 +0530 Subject: [PATCH] chore: made condition strict --- packages/utils/scaffold.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/utils/scaffold.ts b/packages/utils/scaffold.ts index 86300589320..64b4e1e07d6 100644 --- a/packages/utils/scaffold.ts +++ b/packages/utils/scaffold.ts @@ -14,12 +14,13 @@ import { Node } from "./types/NodePath"; function mergeHandler(config: Config, transformations: string[]): [Config, string[]]{ - if(transformations.indexOf("topScope") === -1) + if(!config["topScope"]) { config["topScope"] = [ `const merge = require('webpack-merge')`, `const ${config.merge[0]} = require(${config.merge[1]})` ]; + transformations.push("topScope"); } else { config.topScope.push( `const merge = require('webpack-merge')`, @@ -29,7 +30,7 @@ function mergeHandler(config: Config, transformations: string[]): [Config, strin config.merge = config.merge[0]; transformations.push("merge", "topScope"); - return [config, transformations] + return [config, transformations]; }