Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/generators/add-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,19 @@ export default class AddGenerator extends Generator {
this.configuration.config.webpackOptions.entry = entryOptions;
this.configuration.config.item = action;
});
}
} else {
if (action === "topScope") {
return this.prompt([
Input("topScope", "What do you want to add to topScope?"),
])
.then((topScopeAnswer: {
topScope: string;
}) => {
this.configuration.config.topScope.push(topScopeAnswer.topScope);
done();
});
}
}
const temp: string = action;
if (action === "resolveLoader") {
action = "resolve";
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function runTransform(transformConfig: ITransformConfig, action:

const transformations: string[] = mapOptionsToTransform(config);

if (config.topScope) {
if (config.topScope && transformations.indexOf("topScope") === -1) {
transformations.push("topScope");
}

Expand Down