@@ -100,6 +100,7 @@ type PromptResult = {
100
100
features ?: ( typeof FEATURE_OPTIONS ) [ number ] [ 'value' ] [ ]
101
101
e2eFramework ?: 'cypress' | 'nightwatch' | 'playwright'
102
102
experimentFeatures ?: ( typeof EXPERIMENTAL_FEATURE_OPTIONS ) [ number ] [ 'value' ] [ ]
103
+ needsBareboneTemplates ? : boolean
103
104
}
104
105
105
106
function isValidPackageName ( projectName ) {
@@ -251,6 +252,7 @@ async function init() {
251
252
features : [ ] ,
252
253
e2eFramework : undefined ,
253
254
experimentFeatures : [ ] ,
255
+ needsBareboneTemplates : false ,
254
256
}
255
257
256
258
intro (
@@ -352,7 +354,19 @@ async function init() {
352
354
)
353
355
}
354
356
355
- const { features , experimentFeatures } = result
357
+ if ( argv . bare ) {
358
+ result . needsBareboneTemplates = true
359
+ } else {
360
+ result . needsBareboneTemplates = await unwrapPrompt (
361
+ confirm ( {
362
+ message : language . needsBareboneTemplates . message ,
363
+ // TODO: default to true sometime in the future
364
+ initialValue : false ,
365
+ } ) ,
366
+ )
367
+ }
368
+
369
+ const { features , experimentFeatures , needsBareboneTemplates } = result
356
370
357
371
const needsTypeScript = argv . ts || argv . typescript || features . includes ( 'typescript' )
358
372
const needsJsx = argv . jsx || features . includes ( 'jsx' )
@@ -562,7 +576,7 @@ async function init() {
562
576
} ,
563
577
)
564
578
565
- if ( argv . bare ) {
579
+ if ( needsBareboneTemplates ) {
566
580
trimBoilerplate ( root )
567
581
render ( 'bare/base' )
568
582
// TODO: refactor the `render` utility to avoid this kind of manual mapping?
@@ -629,7 +643,7 @@ async function init() {
629
643
)
630
644
}
631
645
632
- if ( argv . bare ) {
646
+ if ( needsBareboneTemplates ) {
633
647
removeCSSImport ( root , needsTypeScript , needsCypressCT )
634
648
if ( needsRouter ) {
635
649
emptyRouterConfig ( root , needsTypeScript )
0 commit comments