@@ -100,6 +100,7 @@ type PromptResult = {
100100 features ?: ( typeof FEATURE_OPTIONS ) [ number ] [ 'value' ] [ ]
101101 e2eFramework ?: 'cypress' | 'nightwatch' | 'playwright'
102102 experimentFeatures ?: ( typeof EXPERIMENTAL_FEATURE_OPTIONS ) [ number ] [ 'value' ] [ ]
103+ needsBareboneTemplates ? : boolean
103104}
104105
105106function isValidPackageName ( projectName ) {
@@ -251,6 +252,7 @@ async function init() {
251252 features : [ ] ,
252253 e2eFramework : undefined ,
253254 experimentFeatures : [ ] ,
255+ needsBareboneTemplates : false ,
254256 }
255257
256258 intro (
@@ -352,7 +354,19 @@ async function init() {
352354 )
353355 }
354356
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
356370
357371 const needsTypeScript = argv . ts || argv . typescript || features . includes ( 'typescript' )
358372 const needsJsx = argv . jsx || features . includes ( 'jsx' )
@@ -562,7 +576,7 @@ async function init() {
562576 } ,
563577 )
564578
565- if ( argv . bare ) {
579+ if ( needsBareboneTemplates ) {
566580 trimBoilerplate ( root )
567581 render ( 'bare/base' )
568582 // TODO: refactor the `render` utility to avoid this kind of manual mapping?
@@ -629,7 +643,7 @@ async function init() {
629643 )
630644 }
631645
632- if ( argv . bare ) {
646+ if ( needsBareboneTemplates ) {
633647 removeCSSImport ( root , needsTypeScript , needsCypressCT )
634648 if ( needsRouter ) {
635649 emptyRouterConfig ( root , needsTypeScript )
0 commit comments