Skip to content

The @nx/vite plugin provides various migrations to help you migrate to newer versions of vite projects within your Nx workspace. Below is a complete reference for all available migrations.

Version: 22.2.0-beta.1

Create AI Instructions to help migrate users workspaces past breaking changes for Vitest 4.

NameVersion
vitest>=4.0.0

Version: 22.2.0-beta.2

Migrate Vitest usage from @nx/vite to @nx/vitest package.

Version: 22.2.0-beta.1

The following packages will be updated:

NameVersionAlways add to package.json
vitest^4.0.0Updated only
@vitest/coverage-v8^4.0.0Updated only
@vitest/coverage-istanbul^4.0.0Updated only
@vitest/ui^4.0.0Updated only

Version: 22.2.0-beta.3

The following packages will be updated:

NameVersionAlways add to package.json
@analogjs/vite-plugin-angular~2.1.2Updated only
@analogjs/vitest-angular~2.1.2Updated only

Version: 21.5.0-beta.0

The following packages will be updated:

NameVersionAlways add to package.json
vite^7.1.3Updated only

Version: 21.3.0-beta.3

The following packages will be updated:

NameVersionAlways add to package.json
@analogjs/vite-plugin-angular~1.19.1Updated only
@analogjs/vitest-angular~1.19.1Updated only

Version: 21.2.0-beta.3

The following packages will be updated:

NameVersionAlways add to package.json
@analogjs/vite-plugin-angular~1.17.1Updated only
@analogjs/vitest-angular~1.17.1Updated only

Version: 21.1.2-beta.0

The following packages will be updated:

NameVersionAlways add to package.json
@analogjs/vitest-angular~1.16.1Updated only

Version: 20.7.1-beta.0

The following packages will be updated:

NameVersionAlways add to package.json
@analogjs/vite-plugin-angular~1.14.1Updated only
@analogjs/vitest-angular~1.14.1Updated only

Version: 20.5.0-beta.2

Install jiti as a devDependency to allow vite to parse TS postcss files.

This migration ensures that the jiti package is installed.
This is a requirement for Vite to parse postcss configuration files that use TypeScript.

Learn more: https://vite.dev/guide/migration#postcss-load-config

Version: 20.5.0-beta.3

Update resolve.conditions to include defaults that are no longer provided by Vite.

Update resolve.conditions to include defaults

Section titled “Update resolve.conditions to include defaults”

In previous Vite versions, the resolve.conditions option had defaults that were added internally (i.e. ['module', 'browser', 'development|production']).
This default was removed in Vite 6, so this migration adds it to your existing configuration to ensure that the behavior remains intact.

Learn more: https://vite.dev/guide/migration#default-value-for-resolve-conditions

vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({
resolve: {
conditions: ['require'],
},
build: {
outDir: 'dist',
},
});
vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({
resolve: {
conditions: ['require', 'module', 'browser', 'development|production'],
},
build: {
outDir: 'dist',
},
});

Version: 20.5.0-beta.3

Add vite config temporary files to the ESLint configuration ignore patterns if ESLint is used.

Add vite.config.*.timestamp* and vitest.config.*.timestamp* to the root eslint.config.mjs file (using ESLint Flat Config).

eslint.config.mjs
export default [
{
ignores: ['dist'],
},
];
eslint.config.mjs
export default [
{
ignores: ['dist', 'vite.config.*.timestamp*', 'vitest.config.*.timestamp*'],
},
];

Add vite.config.*.timestamp* and vitest.config.*.timestamp* to the project’s .eslintrc.json file (using eslintrc format config).

apps/app1/eslintrc.json
{
"ignorePatterns": ["!**/*"]
}
apps/app1/eslintrc.json
{
"ignorePatterns": [
"!**/*",
"vite.config.*.timestamp*",
"vitest.config.*.timestamp*"
]
}

Version: 20.5.0-beta.3

The following packages will be updated:

NameVersionAlways add to package.json
vite^6.0.0Updated only
vite-plugin-dts~4.5.0Updated only

Version: 20.0.4-beta.0

Add gitignore entry for temporary vite config files.

Add gitignore entry for temporary vite config files.

Adds the following entries to the .gitignore file.

.gitignore
vite.config.*.timestamp*
vitest.config.*.timestamp*

Version: 20.0.6-beta.0

Add gitignore entry for temporary vite config files and remove previous incorrect glob.

Add gitignore entry for temporary vite config files.

Adds the following entries to the .gitignore file.

.gitignore
vite.config.*.timestamp*
vitest.config.*.timestamp*