@nx/vite:init
Initialize Vite in the workspace.
The State of JS survey is live, featuring a monorepo tools sectionThe State of JS survey is live, featuring a monorepo tools sectionVote for us
Please do not extend this schema as it is part of Nx internal usage.
Initialize Vite in the workspace.
This is a generator will initialize Vite.js in your workspace. It will install all the necessary dependencies. You can read more about how this generator works, in the Vite package overview page.
stringYou don't need to use this generator on its own.
This generator will be called automatically when you are either converting an existing React or Web app to use Vite, using the @nx/vite:configuration generator, or when you are creating a new React or Web app using the @nx/react:app or @nx/web:app generators, if you choose vite as the bundler.
If you need to for some reason, you can use it on its own like this:
1nx g @nx/vite:init
21nx g @nx/vite:init --uiFramework=react
21nx g @nx/vite:init --uiFramework=none
21nx generate init ...
21nx g ng-add ... #same
2By default, Nx will search for init in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
1nx g @nx/vite:init ...
2Show what will be generated without writing to disk:
1nx g init ... --dry-run
2babelbabel, swcCompiler to use for Vite when UI Framework is React.
falseAdd dependencies needed to build libraries.
jsdomnode, jsdom, happy-dom, edge-runtimeThe vitest environment to use. See https://vitest.dev/config/#environment.
reactreact, noneUI Framework to use for Vite.