46 lines
2.7 KiB
JSON
46 lines
2.7 KiB
JSON
{
|
|
"name": "init",
|
|
"factory": "./src/generators/init/init",
|
|
"schema": {
|
|
"cli": "nx",
|
|
"title": "Initialize Vite in the workspace.",
|
|
"description": "Initialize Vite in the workspace.",
|
|
"$id": "init-vite-plugin",
|
|
"type": "object",
|
|
"properties": {
|
|
"uiFramework": {
|
|
"type": "string",
|
|
"description": "UI Framework to use for Vite.",
|
|
"enum": ["react", "none"],
|
|
"default": "react",
|
|
"x-prompt": "What UI framework plugin should Vite use?"
|
|
},
|
|
"compiler": {
|
|
"type": "string",
|
|
"description": "Compiler to use for Vite when UI Framework is React.",
|
|
"enum": ["babel", "swc"],
|
|
"default": "babel"
|
|
},
|
|
"includeLib": {
|
|
"type": "boolean",
|
|
"description": "Add dependencies needed to build libraries.",
|
|
"default": false
|
|
},
|
|
"testEnvironment": {
|
|
"description": "The vitest environment to use. See https://vitest.dev/config/#environment.",
|
|
"type": "string",
|
|
"enum": ["node", "jsdom", "happy-dom", "edge-runtime"],
|
|
"default": "jsdom"
|
|
}
|
|
},
|
|
"examplesFile": "---\ntitle: Examples for the Vite init generator\ndescription: This page contains examples for the Vite @nx/vite:init generator, which helps you initialize vite in your Nx workspace, by installing the necessary dependencies.\n---\n\nThis 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](/packages/vite).\n\n{% callout type=\"note\" title=\"string\" %}\nYou don't need to use this generator on its own.\n{% /callout %}\n\nThis 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](/packages/vite/generators/configuration), or when you are creating a new React or Web app using the [`@nx/react:app`](/packages/react/generators/application) or [`@nx/web:app`](/packages/web/generators/application) generators, if you choose `vite` as the `bundler`.\n\nIf you need to for some reason, you can use it on its own like this:\n\n```bash\nnx g @nx/vite:init\n```\n\n## Examples\n\n### Install all the necessary dependencies for Vite and the React plugin\n\n```bash\nnx g @nx/vite:init --uiFramework=react\n```\n\n### Install all the necessary dependencies for Vite\n\n```bash\nnx g @nx/vite:init --uiFramework=none\n```\n",
|
|
"presets": []
|
|
},
|
|
"description": "Initialize Vite in the workspace.",
|
|
"aliases": ["ng-add"],
|
|
"hidden": true,
|
|
"implementation": "/packages/vite/src/generators/init/init.ts",
|
|
"path": "/packages/vite/src/generators/init/schema.json",
|
|
"type": "generator"
|
|
}
|