Skip to content

Commit a2c49e2

Browse files
committed
chore: update types of the config
1 parent 1323bbf commit a2c49e2

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

packages/generators/add-generator.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ export default class AddGenerator extends Generator {
4242
configName?: string;
4343
topScope?: string[];
4444
item?: string;
45-
merge?: {
46-
configName?: string;
47-
topScope?: string[];
48-
item?: string;
49-
webpackOptions?: WebpackOptions;
50-
};
45+
merge?: string|string[];
5146
webpackOptions?: WebpackOptions;
5247
};
5348
};
@@ -112,19 +107,14 @@ export default class AddGenerator extends Generator {
112107
);
113108
}
114109
if (action === "merge") {
115-
return this.prompt([mergeFileQuestion])
110+
return this.prompt(mergeFileQuestion)
116111
.then((mergeFileAnswer: {
117-
mergeFile: string;
112+
mergeFile: string,
113+
mergeConfigName: string
118114
}) => {
119115
const resolvedPath = resolve(process.cwd(), mergeFileAnswer.mergeFile);
120116
// eslint-disable-next-line
121-
const mergeConfig = require(resolvedPath);
122-
(this.configuration.config.merge as {
123-
configName?: string;
124-
topScope?: string[];
125-
item?: string;
126-
webpackOptions?: WebpackOptions;
127-
}) = mergeConfig;
117+
this.configuration.config["merge"] = [mergeFileAnswer.mergeConfigName, resolvedPath];
128118
});
129119
}
130120
}

packages/utils/modify-config-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface Config extends Object {
1414
};
1515
topScope?: string[];
1616
configName?: string;
17-
merge: object;
17+
merge: string|string[];
1818
webpackOptions: object;
1919
}
2020

0 commit comments

Comments
 (0)