@@ -18,6 +18,7 @@ import generateReadme from './utils/generateReadme'
1818import getCommand from './utils/getCommand'
1919import getLanguage from './utils/getLanguage'
2020import renderEslint from './utils/renderEslint'
21+ import trimBoilerplate from './utils/trimBoilerplate'
2122
2223function isValidPackageName ( projectName ) {
2324 return / ^ (?: @ [ a - z 0 - 9 - * ~ ] [ a -z 0 -9 -* ._ ~ ] * \/ ) ? [ a - z 0 - 9 - ~ ] [ a - z 0 - 9 - ._ ~ ] * $ / . test ( projectName )
@@ -83,7 +84,9 @@ async function init() {
8384 // --playwright
8485 // --eslint
8586 // --eslint-with-prettier (only support prettier through eslint for simplicity)
86- // --force (for force overwriting)
87+ // in addition to the feature flags, you can also pass the following options:
88+ // --bare (for a barebone template without example code)
89+ // --force (for force overwriting without confirming)
8790
8891 const args = process . argv . slice ( 2 )
8992
@@ -319,8 +322,8 @@ async function init() {
319322 packageName = projectName ?? defaultProjectName ,
320323 shouldOverwrite = argv . force ,
321324 needsJsx = argv . jsx ,
322- needsTypeScript = argv . ts || argv . typescript ,
323- needsRouter = argv . router || argv [ 'vue-router' ] ,
325+ needsTypeScript = ( argv . ts || argv . typescript ) as boolean ,
326+ needsRouter = ( argv . router || argv [ 'vue-router' ] ) as boolean ,
324327 needsPinia = argv . pinia ,
325328 needsVitest = argv . vitest || argv . tests ,
326329 needsPrettier = argv [ 'eslint-with-prettier' ] ,
@@ -563,6 +566,25 @@ async function init() {
563566 )
564567 }
565568
569+ if ( argv . bare ) {
570+ trimBoilerplate ( root , { needsTypeScript, needsRouter } )
571+ render ( 'bare/base' )
572+
573+ // TODO: refactor the `render` utility to avoid this kind of manual mapping?
574+ if ( needsTypeScript ) {
575+ render ( 'bare/typescript' )
576+ }
577+ if ( needsVitest ) {
578+ render ( 'bare/vitest' )
579+ }
580+ if ( needsCypressCT ) {
581+ render ( 'bare/cypress-ct' )
582+ }
583+ if ( needsNightwatchCT ) {
584+ render ( 'bare/nightwatch-ct' )
585+ }
586+ }
587+
566588 // Instructions:
567589 // Supported package managers: pnpm > yarn > bun > npm
568590 const userAgent = process . env . npm_config_user_agent ?? ''
0 commit comments