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.

21.5.x

21.5.0-package-updates

Version: 21.5.0-beta.0

Packages

The following packages will be updated:

NameVersionAlways add to package.json
vite^7.1.3Updated only

21.3.x

21.3.0-package-updates

Version: 21.3.0-beta.3

Packages

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

21.2.x

21.2.0-package-updates

Version: 21.2.0-beta.3

Packages

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

21.1.x

21.1.2-package-updates

Version: 21.1.2-beta.0

Packages

The following packages will be updated:

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

20.7.x

20.7.1-package-updates

Version: 20.7.1-beta.0

Packages

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

20.5.x

update-20-5-0-install-jiti

Version: 20.5.0-beta.2

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

Installs the jiti package

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

update-20-5-0-update-resolve-conditions

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

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

{% callout type=“note” title=“Remix” %}

Remix does not currently support Vite 6 and therefore any vite.config file for Remix will not be migrated.

{% /callout %}

Sample Code Changes

{% tabs %} {% tab label=“Before” %}

import { defineConfig } from 'vite';
export default defineConfig({
resolve: {
conditions: ['require'],
},
build: {
outDir: 'dist',
},
});

{% /tab %} {% tab label=“After” %}

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

{% /tab %} {% /tabs %}

eslint-ignore-vite-temp-files

Version: 20.5.0-beta.3

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

Sample Code Changes

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

{% tabs %} {% tab label=“Before” %}

export default [
{
ignores: ['dist'],
},
];

{% /tab %} {% tab label=“After” %}

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

{% /tab %}

{% /tabs %}

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

{% tabs %} {% tab label=“Before” %}

{
"ignorePatterns": ["!**/*"]
}

{% /tab %} {% tab label=“After” %}

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

{% /tab %}

{% /tabs %}

20.5.0-package-updates

Version: 20.5.0-beta.3

Packages

The following packages will be updated:

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

20.3.x

update-20-3-0

Version: 20.3.0-beta.2

Add gitignore entry for temporary vitest config files.

Add Vitest Temp Files to Git Ignore

Add gitignore entry for temporary vitest config files.

Sample Code Changes

Adds the following entries to the .gitignore file.

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

20.0.x

update-20-0-4

Version: 20.0.4-beta.0

Add gitignore entry for temporary vite config files.

Add Vite Temp Files to Git Ignore

Add gitignore entry for temporary vite config files.

Sample Code Changes

Adds the following entries to the .gitignore file.

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

update-20-0-6

Version: 20.0.6-beta.0

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

Add Vite Temp Files to Git Ignore

Add gitignore entry for temporary vite config files.

Sample Code Changes

Adds the following entries to the .gitignore file.

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

19.6.x

update-19-6-0-add-depends-on-for-preview-server

Version: 19.6.0-beta.0

Add dependsOn: [build] to preview targets using preview-server