Repository navigation
Description
Description
I'd like to initialize a Vite+ project from scratch without choosing a framework or an opinionated application/library template.
My typical workflow is to create an empty GitHub repository, clone it into my IDE, and initialize the project in the cloned directory using vp create --directory . (thanks to #1077!).
However, when none of the existing templates fit my project, I have to initialize package.json using a separate package manager command before I can start adding dependencies with vp add.
I'd like to use Vite+ commands for the entire setup process while keeping the project's structure and dependencies up to the developer.
Suggested solution
Add a new built-in template, vite:bare, which initializes a minimal Vite+ project without any framework-specific boilerplate.
For example, the workflow would be:
# Inside an existing empty Git repository
vp create vite:bare --directory .
vp add <packages>
It should also support creating a new directory, like other built-in templates:
vp create vite:bare
cd my-project
vp add <packages>
The generated project should contain:
- A minimal
package.jsonwith the project name andvite-plusas a dev dependency. - No framework-specific dependencies, source files, or example application code.
- Any necessary package manager files and optional setup files generated through the existing
vp createworkflow.
Ideally, this template would be available through both vp create vite:bare and the interactive template picker, and would support existing options such as --directory, --package-manager, and --no-interactive.
This would provide an unopinionated starting point that developers can customize using vp add, without introducing a separate initialization command.
Alternative
- Manually initialize the project with a package manager
For example:
pnpm init
vp add -D vite-plus
vp add <packages>
This works, but requires using a separate package manager command to bootstrap the project instead of relying entirely on vp.
- Use
vite:applicationorvite:libraryand remove the unnecessary files
These templates work well for their intended use cases, but require additional cleanup when starting a project that doesn't fit either structure.
- Introduce a new
vp initcommand
This could also solve the problem, but adding a built-in template seems more consistent with the existing vp create workflow and requires no new top-level command.
Additional context
Related issues:
- Feature request: Add way to create project in cwd #1077 added support for initializing projects in the current directory with
vp create --directory .. - Add
vp initcommand as alias forvp create -directory .#1192 discussed introducingvp init, where the maintainers expressed a preference for usingvp createfor new projects andvp migratefor existing ones.
This proposal builds on that approach. It doesn't request changes to directory handling or a new command, only an additional built-in template for projects that don't need a predefined structure.
Validations
- Read the Contributing Guidelines.
- Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
- Check that there isn't already an issue requesting the same feature.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Start date
Target date
Effort
Activity
jong-kyung commentedon Nov 11, 2026
vp add -D vite-plusalready works in an empty directory withoutpnpm init, because it createspackage.jsonfor you.What would
vite:bareadd on top of that?cc/ @fengmk2
AXT-AyaKoto commentedon Nov 11, 2026
Oh, I didn't realize
vp addcould initialize a project in an empty directory!My main goal was to start a minimal Vite+ project without using a separate package manager command, so
vp add -D vite-plusalready covers my use case.That said, I think there are still two aspects worth considering:
vp addrequired an existingpackage.json, so this behavior wasn't obvious to me. This could be addressed either by adding avite:baretemplate or by documenting the implicit initialization behavior ofvp add.vp createto start new projects. Having avite:baretemplate would let developers follow that same workflow even when they don't need a predefined project structure.I'm not sure these benefits justify adding another built-in template, so I'll leave that judgment to the maintainers. I'd appreciate your thoughts on whether either approach would be worthwhile.
Thanks for pointing this out!
AXT-AyaKoto commentedon Nov 11, 2026
I noticed this issue was closed as not planned. I understand that
vite:baremight not be necessary given the existingvp add -D vite-plusworkflow.However, I'm not sure whether the discoverability and consistency concerns I mentioned were considered, since the issue was closed without further explanation.
Could you clarify whether the decision is that the current workflow is sufficient as-is, or whether improvements such as documenting the implicit initialization behavior of
vp addwould still be welcome?I'm not necessarily asking to reopen this issue. I'd just like to better understand the reasoning behind the decision.
Thanks!
jong-kyung commentedon Nov 11, 2026
Sorry for closing this without an explanation.
I closed it because
vp add -D vite-plusalready covers the workflow you described, and I could not picture a project that would want onlyvite-plusinstalled with nothing else. Vite+ is a toolchain for web development, so the docs guide users to start from a template withvp create.Could you share what kind of project you were starting, and what did not fit in
vite:applicationorvite:library? A concrete example would help us decide whether this is worth a template or a docs change. I am happy to reopen the issue if there is a case we are missing.AXT-AyaKoto commentedon Nov 11, 2026
Thanks for the explanation!
To clarify, I don't intend to keep a project with only
vite-plusinstalled. The idea is to usevite:bareas a minimal starting point before adding the framework and dependencies I actually need.One concrete scenario I have in mind is a Vite+ monorepo structured like this:
There are two cases where the existing templates don't quite fit:
wxt init, but its official starter templates don't include Preact. I'd prefer to configure WXT with Preact manually rather than start fromvite:applicationand remove unrelated Vite application boilerplate.vitepress init. It doesn't provide a standalonecreate-*template that could be used throughvp create.Ideally, I could initialize each package through Vite+'s existing
vp createworkflow:The main benefit I'm looking for is a consistent way to create minimal workspace packages through
vp create, including its monorepo integration, without being tied to a particular framework template.I understand that
vp add -D vite-plusalready handles initialization in an empty directory, so I'm not suggesting thatvite:bareis strictly necessary. However, I think it could make these monorepo workflows more straightforward and consistent.I hope this clarifies the use case. I'd be interested to hear whether you think this is worth supporting through a built-in template or whether a documented workflow using existing commands would be preferable.
jong-kyung commentedon Nov 11, 2026
Thanks for the detailed explanation, that makes sense.
For the monorepo case you described, I think code generators are a good fit.
vp create vite:generatorscaffolds a generator package and registers it increate.templates, so you can define your own minimal template and run it withvp create <name>. Packages created this way go through the regular monorepo integration, which is the benefit you were looking for fromvite:bare. You could also go one step further and turn your WXT with Preact setup or your VitePress setup into templates.Outside a monorepo,
vp add -D vite-plusin an empty directory covers the single project case.In my personal opinion, these two cover both scenarios, so a built-in
vite:baretemplate does not seem necessary. What do you think?AXT-AyaKoto commentedon Nov 11, 2026
Thanks for the suggestion! I agree that code generators would technically cover this use case, including monorepo integration.
My concern is that I'm not looking to create reusable templates. I just want to initialize a couple of packages for a specific project, potentially with different frameworks each time. Creating and maintaining a custom generator for a one-off setup feels like more overhead than the initialization itself.
I still think a built-in
vite:baretemplate would be a convenient and consistent way to handle this. However, I also understand that adding another built-in template comes with a maintenance cost, which may not be justified for this use case.Given that
vp add -D vite-plusalready works in an empty directory, I think documenting this workflow would be a reasonable and lightweight solution. For example, a short section explaining how to initialize a minimal project without a template, including how to use that approach within an existing monorepo, would make the option much easier to discover.So while I'd still welcome
vite:bareif the maintainers consider it worthwhile, I'd be happy with a documentation improvement instead.What do you think?
jong-kyung commentedon Nov 11, 2026
Thanks, I understand the concern about one-off setups.
About documenting it: creating
package.jsononaddis a side effect of the underlying package manager, not a Vite+ feature. The package managers themselves do not document it as a way to initialize a project, and the behavior is not the same across all of them. So in my personal opinion, it would be odd for Vite+ to document it as an official workflow.For a one-off package, the existing options should be enough for now.
AXT-AyaKoto commentedon Nov 11, 2026
Thanks for clarifying! I didn't realize that initializing a project through
vp addwas an incidental behavior of the underlying package manager rather than something Vite+ guarantees.That actually makes me think there's another benefit to
vite:bare: it could provide a consistent, officially supported way to initialize a minimal project regardless of the package manager.To clarify, this isn't limited to monorepos. I'd also like to use Vite+ for standalone WXT + Preact projects, where the existing application and library templates don't quite fit.
I agree that the existing options make these setups possible, but I still find the developer experience less than ideal:
vp addrelies on initialization behavior that isn't guaranteed across package managers.vite:applicationrequires removing unnecessary boilerplate.vite:generatoradds significant setup overhead for a one-off project.I understand that maintaining another built-in template has a cost, and I don't want to push for a feature that the maintainers don't consider worthwhile.
However, I'd like to ask: What is the recommended, officially supported way to initialize a minimal Vite+ project (or a package within an existing monorepo) when none of the built-in templates fit?
If there's an existing workflow I've overlooked, I'd be happy to use it. Otherwise, I think there's still a small gap in the current developer experience, even if adding
vite:bareisn't the right solution.Thanks again for taking the time to discuss this!
naokihaba commentedon Nov 14, 2026
@AXT-AyaKoto cc @jong-kyung @fengmk2
Thanks for the proposal and for explaining the context.
I read through the thread, and it makes sense why you'd want this if the built-in templates don't fit and you'd prefer to handle everything with
vp.That said,
vp createis really meant to generate runnable, working apps out of the box (similar tocreate-vite), rather than empty scaffolds. Like @cpojer mentioned in #1192, adding something like a bare template starts to blur the line withvp migrate, so we'd like to keep the distinction as is.For your case, the best path is probably to scaffold the project first with the framework tool (e.g.
wxt init) and then runvp migrate. If you're working in a monorepo, you can just init it directly underapps/. The root workspace already handles Vite+ via overrides and the catalog, so the new package should pick it up automatically.naokihaba commentedon Nov 14, 2026
Reopening this to keep the conversation going. We still need to decide if this workflow belongs in the guide.
voidzero-bot commentedon Nov 14, 2026
vite:baretemplate affects a specific use case (starting from an empty scaffold) and there are existing workarounds:vp add -D vite-plusin an empty directory,vp create vite:generatorfor monorepo packages, or scaffolding with the framework tool and runningvp migrate.vp create vite:barefails because the built-in template set is hard-coded inpackages/cli/src/create/templates/types.tsto only includevite:monorepo,vite:application,vite:library, andvite:generator. Any othervite:*specifier falls through to an “unknown builtin template” error inpackages/cli/src/create/templates/builtin.ts. This is consistent with documented behavior and with recent maintainer comments thatvp createis intended for runnable apps, whilevp migratecovers existing projects.I wasn't able to find a fix, but I identified some areas that may be relevant. If the project decides to add the template, the main touchpoints are
BuiltinTemplateinpackages/cli/src/create/templates/types.ts, the execution branch inpackages/cli/src/create/templates/builtin.ts, the picker options inpackages/cli/src/create/initial-template-options.ts, and the--listhelp text inpackages/cli/src/create/bin.ts. If the decision is to keepvite:bareout and instead document the workflow,docs/guide/create.mdis the right place to clarify the recommended alternatives.Full Triage Report
Triage Report: Issue #3427 —
feat(create): add a minimal vite:bare built-in templateReproduction summary
vp create vite:bareis rejected as an unknown builtin template:vp create --listonly shows the four existing built-in templates:vite:monorepo,vite:application,vite:library,vite:generator.Root cause
The create command’s built-in template set is hard-coded in the CLI and currently does not include an entry for a bare/minimal Vite+ project.
Affected source locations:
packages/cli/src/create/templates/types.ts:BuiltinTemplateis defined as:There is no
bare: 'vite:bare'entry.packages/cli/src/create/templates/builtin.ts:BuiltinTemplate.applicationis rewritten tocreate-vite@latest.BuiltinTemplate.libraryis downloaded via degit from thetsdown-templates/vite-plusrepository.Any other
vite:*name falls through to:packages/cli/src/create/initial-template-options.ts: the interactive picker only offers the four templates above (plus monorepo-local generators inside a monorepo).packages/cli/src/create/bin.ts(listTemplatesMessage): the--listhelp text documents the same four built-in templates.Why this causes the reported behavior
vp createroutes anyvite:*specifier throughexecuteBuiltinTemplate. Becausevite:bareis absent fromBuiltinTemplate, it reaches the unknown-builtin branch and exits with code1. The picker likewise never offers it.Suggested fix approach
There are two reasonable resolutions, with different product scope:
Option A — Add a
vite:barebuilt-in template (feature implementation)bare: 'vite:bare'toBuiltinTemplateinpackages/cli/src/create/templates/types.ts.packages/cli/src/create/templates/builtin.tsthat:package.jsoncontaining the projectname, maybeversion: "0.0.0", andvite-plusas a dev dependency.projectDirso the caller (packages/cli/src/create/bin.ts) proceeds with the normal post-create flow (agent instructions, editor config, package manager pinning, dependency install, formatting, git init, monorepo integration etc.).vite:bareto the picker inpackages/cli/src/create/initial-template-options.ts.--listhelp text inpackages/cli/src/create/bin.ts.packages/cli/src/create/__tests__/builtin.spec.tsandinitial-template-options.spec.ts.The existing scaffold flow already handles package-name detection,
--directory,--package-manager,--no-interactive, monorepo integration, and post-create setup, so the bare template can mostly reuse that infrastructure.Option B — Document the recommended workflow (docs-only)
As noted by maintainers in the issue discussion,
vp createis intended to produce runnable apps, and a bare/empty scaffold blurs the line withvp migrate. The reopened issue asks whether the workflow belongs in the guide instead.If the product decision is to not add a built-in template, the recommended place to document the workflow is
docs/guide/create.md. It could include a short section explaining that when none of the built-in templates fit, the preferred path is to scaffold with the framework’s own tool (e.g.wxt init,vitepress init) and then runvp migrate, becausevp migrateis the command designed for bringing existing projects into Vite+.Edge cases / implementation notes if Option A is chosen
vite:application/vite:libraryfor--directory, parent-dir inference, workspace registration, catalog entries, and monorepo rewrite. Reusing the existing direct-scaffold path inbin.tshandles most of this automatically.src/,public/, or framework-specific config. It should still let the normal create flow write optional agent/editor configs and a.gitignoreif requested.vp install; the bare template only needs to supply the minimalpackage.jsonfirst.just snapshot-testto review diffs.Regression evidence
No existing implementation of
vite:barewas found. Existing built-in templates are explicitly listed in two places (type definition and the--listhelp message), so adding a fifth template requires updates to both to keep them consistent.Confidence
High. The absence of
vite:barefrom the hard-coded built-in template set is proven by bothvp create --listoutput and code inspection. The exact code path that rejects it is identified, and the existing create infrastructure makes the implementation straightforward if the product decision is to add it.Verification
Claim
Reporter expects
vp create vite:bareto exist as a built-in template that scaffolds a minimal Vite+ project (just apackage.jsonandvite-plusas a dev dependency). Instead, Vite+ rejects it as an unknown built-in template.Verdict
intended-behaviorConfidence
High.
Evidence
Documented built-in template set
docs/guide/create.mdlists only:vite:monorepovite:applicationvite:libraryvite:generatorpackages/cli/src/create/templates/types.tshard-codes exactly those four names;vite:bareis absent.packages/cli/src/create/__tests__/initial-template-options.spec.tsasserts the same list, so the behavior is enforced by tests.Rejection path is explicit
packages/cli/src/create/templates/builtin.tsintentionally treats every othervite:*specifier as unknown and exits with code1:Maintainer intent expressed in issue discussion
vp createis really meant to generate runnable, working apps out of the box (similar tocreate-vite), rather than empty scaffolds. … adding something like a bare template starts to blur the line withvp migrate.”wxt init) and then runningvp migrate, or usingvp create vite:generatorfor reusable monorepo scaffolds.Existing alternatives cover the described workflow
vp add -D vite-pluscreatespackage.jsonimplicitly through the package manager.vp create vite:generatorscaffolds a Bingo-based code generator that can be registered increate.templatesand reused through the normalvp createflow with monorepo integration.vp migrate.Conclusion
The absence of
vite:bareis not a bug; it reflects a deliberate product boundary betweenvp create(runnable templates) andvp migrate(bringing existing projects into Vite+). The workflow requested by the reporter is already supported throughvp add,vp create vite:generator, or framework init +vp migrate. The reopened issue asks whether this workflow should be documented in the guide; if so, the change belongs indocs/guide/create.mdrather than in the code.This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
AXT-AyaKoto commentedon Nov 14, 2026
Thanks for taking the time to read through the discussion, @naokihaba!
I see your point about the intended purpose of
vp create. If it's meant to scaffold runnable applications rather than empty projects, I agree that addingvite:bareprobably isn't the right approach.I also tried the workflow you suggested, and it seems to work well!
vp dlx wxt@latest init, then ranvp migrate. The development server started successfully.vp create vite:monorepo, initialized WXT underapps/extensionusingvp -C apps/extension dlx wxt@latest init, and addedpreactand@preact/preset-viteusingvp add. The development server started successfully here too, and I confirmed thatnode_modules/viteresolves to@voidzero-dev/vite-plus-core.I haven't fully tested the Preact integration or every aspect of the setup yet, but the initial results look promising.
That said, I think there's still one use case worth considering: What if a framework or tool doesn't provide a suitable initializer or starter template?
In that case, developers may need to create a
package.jsonfrom scratch before adding dependencies. Of course, they can usepnpm init,npm init, or another package manager's equivalent, so this isn't a blocker. But it does mean that the initial setup can't be completed entirely through Vite+ commands.Perhaps the question is no longer whether we should add
vite:bare, but rather:Should Vite+ provide a package-manager-independent way to initialize a minimal
package.json?A couple of possible approaches come to mind:
vp pm init, delegating to the selected package manager's native initialization command.package.jsonitself, providing consistent behavior across package managers.I'm not necessarily proposing either of these as a new feature yet. I'd first like to understand whether this use case falls within Vite+'s intended scope.
Regardless, I think documenting the recommended framework initializer →
vp migrateworkflow would be helpful, especially for users who aren't sure how to start with frameworks that don't have a built-in Vite+ template.Thanks again for the clarification and for reopening the discussion!
naokihaba commentedon Nov 14, 2026
@AXT-AyaKoto Thanks for testing both setups and sharing your findings!
@jong-kyung @fengmk2 cc @AXT-AyaKoto
Before making any changes, I just wanted to make sure we're on the same page regarding the direction.
Personally, I don't feel adding a package-manager-independent way to create a
package.jsonreally fits Vite+'s scope.Looking at the pm command group RFC,
vp pmcommands are mainly intended to be thin wrappers that delegate directly to whatever package manager is detected in the project. In an empty directory where there's no lockfile orpackageManagerfield yet, it has nothing to detect. According to the package manager detection RFC,vp pmfalls back to pnpm by default outside of projects without prompting. That meansvp pm initwould essentially just runpnpm init. Making it interactive so users can choose and record their package manager would basically duplicate whatvp createalready handles.Having Vite+ generate a minimal
package.jsonon its own also runs into the same questions asvite:bare. Tools might or might not provide their own initializers, and I'd prefer not to design Vite+ commands around those edge cases. For tools that don't ship one, running the package manager's nativeinitcommand is straightforward enough.On the docs side, I think adding a quick tip to the end of the "Template Sources" section in
docs/guide/create.mdwould be the best approach. I left monorepos out for now since npm might not apply rootoverridesto newly created workspace members (see #3455).Here is what I'm thinking of adding:
I gave this a run with wxt 0.21.5 and Vite+ 1.5.0. Running
vp migratecorrectly pointsviteto@voidzero-dev/vite-plus-core, andvp run buildsucceeds without issues.Let me know what you think. If this sounds good, I'll go ahead and open a docs PR.
jong-kyung commentedon Nov 14, 2026
I agree with not adding
vite:bareorvp pm init.On the docs side, I am not sure the tip is needed, for two reasons.
First, the guide already points existing projects to
vp migrate, and a project created by another tool's initializer is an existing project at that point.Second, the WXT case already works through
vp createwith a remote template, which the "Template Sources" section lists:I tried this with Vite+ 1.6.0, and
vp run buildsucceeds withviteresolving to@voidzero-dev/vite-plus-core.I would lean toward closing this without a docs change, but I am fine either way if others think the tip is useful.
naokihaba commentedon Nov 14, 2026
@jong-kyung
A project generated by another tool is an existing project, and the guide already tells people to use vp migrate for that. So I agree with you. A remote template is a better fit for WXT, because vp create handles the whole setup.
@AXT-AyaKoto
I mentioned a docs tip earlier, but after another look, I don't think we need it. The guide already says to use
vp migratefor existing projects, and a project from another tool's initializer is one of them. Separate steps for each framework would repeat the same thing. So I'll close this without a docs change.AXT-AyaKoto commentedon Nov 14, 2026
Thanks for the explanations, @naokihaba and @jong-kyung!
I knew that
vp createsupports GitHub templates, but I wasn't aware that WXT had a suitable template available. That's a good point, and it looks like a useful alternative to running its initializer separately.Regarding
vp pm init, I understand the concerns about adding another command. One small detail I'd like to mention is that, inside an existing monorepo, Vite+ can detect the package manager from the workspace root even when the new package doesn't have apackage.jsonyet. Sovp pm initcould potentially delegate to the workspace's package manager rather than always defaulting to pnpm.That said, I understand this may not be enough to justify a new subcommand, and I'm happy to leave that decision to the maintainers.
As for the docs, I see both sides. The existing documentation already covers remote templates and
vp migrate, as @jong-kyung pointed out. However, not every framework or tool is guaranteed to provide a suitable template that can be used withvp create. I still think a short tip could be useful to explicitly connect the two workflows: when a suitable template isn't available throughvp create, developers can use the framework's own initializer and then runvp migrate.The WXT example is fine with me, though another example might be more appropriate given that WXT already has a usable GitHub template.
I'd welcome the documentation improvement, but I'm happy to leave the final decision to the maintainers.
Thanks again for the discussion!
fengmk2 commentedon Nov 15, 2026
Thanks @AXT-AyaKoto, @jong-kyung, and @naokihaba for the thoughtful discussion and for testing the different workflows.
I’ll update
docs/guide/create.mdto clarify what to do when no suitable template is available: use the framework’s own initializer, then follow thevp migrateguide. We already document both commands, but connecting these steps where users look for project creation options should make this path easier to discover.docs(create): explain setup when no template fits (#3456)