File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ class CreateJavascriptProject extends Command {
2828 await checkPackageJson ( ) ;
2929 const answers = await collectAnswers ( ) ;
3030
31+ if ( answers . configurations . includes ( "flow" ) || answers . framework !== "none" ) {
32+ answers . module = "esm" ;
33+ }
34+
3135 const formatterFactory = FormatterFactory . getInstance ( ) ;
3236 const formatter = formatterFactory . createFormatter ( answers . format ) ;
3337
Original file line number Diff line number Diff line change 11import { prompt } from "inquirer" ;
2- import { GeneratorType , InquirerConfigs , Module } from "./types" ;
2+ import { GeneratorType , InquirerConfigs } from "./types" ;
33
44export async function collectAnswers ( ) : Promise < InquirerConfigs > {
55 const answers = await prompt < InquirerConfigs > ( [
@@ -53,11 +53,6 @@ export async function collectAnswers(): Promise<InquirerConfigs> {
5353 { name : "CommonJS (require/exports)" , value : "commonjs" } ,
5454 ] ,
5555 when : ( answers ) => ! answers . configurations . includes ( "flow" ) && answers . framework === "none" ,
56- validate : ( input : Module , answers ) => {
57- return input === "commonjs" && answers ?. framework === "react"
58- ? "You cannot use React with commonjs"
59- : true ;
60- } ,
6156 } ,
6257 {
6358 type : "confirm" ,
You can’t perform that action at this time.
0 commit comments