Skip to content

Commit

Permalink
chore: update types of the config
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh3112 committed May 29, 2019
1 parent 1323bbf commit a2c49e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
20 changes: 5 additions & 15 deletions packages/generators/add-generator.ts
Expand Up @@ -42,12 +42,7 @@ export default class AddGenerator extends Generator {
configName?: string;
topScope?: string[];
item?: string;
merge?: {
configName?: string;
topScope?: string[];
item?: string;
webpackOptions?: WebpackOptions;
};
merge?: string|string[];
webpackOptions?: WebpackOptions;
};
};
Expand Down Expand Up @@ -112,19 +107,14 @@ export default class AddGenerator extends Generator {
);
}
if (action === "merge") {
return this.prompt([mergeFileQuestion])
return this.prompt(mergeFileQuestion)
.then((mergeFileAnswer: {
mergeFile: string;
mergeFile: string,
mergeConfigName: string
}) => {
const resolvedPath = resolve(process.cwd(), mergeFileAnswer.mergeFile);
// eslint-disable-next-line
const mergeConfig = require(resolvedPath);
(this.configuration.config.merge as {
configName?: string;
topScope?: string[];
item?: string;
webpackOptions?: WebpackOptions;
}) = mergeConfig;
this.configuration.config["merge"] = [mergeFileAnswer.mergeConfigName, resolvedPath];
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/modify-config-helper.ts
Expand Up @@ -14,7 +14,7 @@ export interface Config extends Object {
};
topScope?: string[];
configName?: string;
merge: object;
merge: string|string[];
webpackOptions: object;
}

Expand Down

0 comments on commit a2c49e2

Please sign in to comment.