When generating a new library, the deprecated cache.dir is still present in the generated config, even though it should not be there anymore (https://github.com/nrwl/nx/pull/26756).
yarn nx g @nx/react:library --directory libs/test --name test --importPath test
Select "vitest", "none" and "as provided" for the prompts:
√ What unit test runner should be used? · vitest
√ Which bundler would you like to use to build the library? Choose 'none' to skip build setup. · none
√ What should be the project name and where should it be generated? · test @ libs/test
The generated libs/test/vite.config.ts file still contains the deprecated cache.dir option:
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
Current Behavior
When generating a new library, the deprecated
cache.dir
is still present in the generated config, even though it should not be there anymore (https://github.com/nrwl/nx/pull/26756).Expected Behavior
No
cache.dir
option in generated vite config.GitHub Repo
No response
Steps to Reproduce
Checkout the example repo (https://github.com/nrwl/nx-examples)
yarn
to install dependenciesyarn nx g @nx/react:library --directory libs/test --name test --importPath test
Select "vitest", "none" and "as provided" for the prompts:
The generated
libs/test/vite.config.ts
file still contains the deprecatedcache.dir
option:export default defineConfig({ root: __dirname, cacheDir: '../../node_modules/.vite/libs/test',
plugins: [react(), nxViteTsPaths()],
// Uncomment this if you are using workers. // worker: { // plugins: [ nxViteTsPaths() ], // },
test: { watch: false, globals: true, cache: { dir: '../../node_modules/.vitest/libs/test' }, // <- HERE environment: 'jsdom', include: ['src/*/.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], coverage: { reportsDirectory: '../../coverage/libs/test', provider: 'v8' }, }, });
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response