nx/docs/generated/packages/vite/migrations/update-20-5-0-update-resolve-conditions.json
Colum Ferry c1ebcb9129
feat(vite): add support for vite 6 (#29871)
## Current Behavior
Nx currently supports Vite at version 5. Nx does not generate vite
configurations using Vite 6 which has been released.
 

## Expected Behavior
Nx should use Vite 6 for vite projects.

## TODO
- [x] Add Package Update Migrations for Existing Projects
- [x] Add AST migrations to handle breaking change in resolve.extensions
- [x] Add migration to install `jsx` or `jiti` to handle processing TS
postcss config files
2025-02-11 11:28:23 -05:00

13 lines
1.7 KiB
JSON

{
"name": "update-20-5-0-update-resolve-conditions",
"version": "20.5.0-beta.3",
"description": "Update resolve.conditions to include defaults that are no longer provided by Vite.",
"implementation": "/packages/vite/src/migrations/update-20-5-0/update-resolve-conditions.ts",
"aliases": [],
"hidden": false,
"path": "/packages/vite",
"schema": null,
"type": "migration",
"examplesFile": "#### Update `resolve.conditions` to include defaults\n\nIn previous Vite versions, the `resolve.conditions` option had defaults that were added internally (i.e. `['module', 'browser', 'development|production']`). \nThis default was removed in Vite 6, so this migration adds it to your existing configuration to ensure that the behavior remains intact.\n\nLearn more: [https://vite.dev/guide/migration#default-value-for-resolve-conditions](https://vite.dev/guide/migration#default-value-for-resolve-conditions)\n\n{% callout type=\"note\" title=\"Remix\" %}\n\nRemix does not currently support Vite 6 and therefore any `vite.config` file for Remix will not be migrated.\n\n{% /callout %}\n\n#### Sample Code Changes\n\n{% tabs %}\n{% tab label=\"Before\" %}\n\n```{% fileName=\"vite.config.ts\" %}\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n resolve: {\n conditions: ['require'],\n },\n build: {\n outDir: 'dist',\n },\n});\n```\n\n{% /tab %}\n{% tab label=\"After\" %}\n\n```{% highlightLines=[4,5,6] fileName=\"vite.config.ts\" %}\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n resolve: {\n conditions: ['require', 'module', 'browser', 'development|production'],\n },\n build: {\n outDir: 'dist',\n },\n});\n```\n\n{% /tab %}\n{% /tabs %}\n"
}