Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: made condition strict
  • Loading branch information
rishabh3112 committed May 29, 2019
1 parent a2c49e2 commit 88eec7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/utils/scaffold.ts
Expand Up @@ -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')`,
Expand All @@ -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];
}


Expand Down

0 comments on commit 88eec7c

Please sign in to comment.