Skip to content

Commit

Permalink
misc: not scaffold 'dist' in default
Browse files Browse the repository at this point in the history
  • Loading branch information
EvsChen committed Dec 22, 2018
1 parent a5a867a commit 2a0bf4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/generators/init-generator.ts
Expand Up @@ -128,7 +128,13 @@ export default class InitGenerator extends Generator {
if (outputTypeAnswer.outputType.length) {
outputPath = outputTypeAnswer.outputType;
}
if (!this.usingDefaults) {
// If entry is single and default output path is chosen
// output path is default to 'dist' by webpack
const isSingleEntry = typeof this.configuration.config.webpackOptions.entry === "string";
if (
!this.usingDefaults &&
!(outputTypeAnswer.outputType.length === 0 && isSingleEntry)
) {
this.configuration.config.webpackOptions.output.path = `path.resolve(__dirname, '${outputPath}')`;
}
})
Expand Down

0 comments on commit 2a0bf4b

Please sign in to comment.