@nx/vite 23.0.0-beta.17 → 23.0.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/PLUGIN.md +33 -0
  2. package/{executors.d.ts → dist/executors.d.ts} +0 -1
  3. package/{index.d.ts → dist/index.d.ts} +0 -1
  4. package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
  5. package/{plugins → dist/plugins}/nx-copy-assets.plugin.d.ts +0 -1
  6. package/{plugins → dist/plugins}/nx-tsconfig-paths.plugin.d.ts +0 -1
  7. package/{plugins → dist/plugins}/nx-vite-build-coordination.plugin.d.ts +0 -1
  8. package/{plugins → dist/plugins}/rollup-replace-files.plugin.d.ts +0 -1
  9. package/{src → dist/src}/executors/build/build.impl.d.ts +0 -1
  10. package/{src → dist/src}/executors/build/build.impl.js +3 -35
  11. package/{src → dist/src}/executors/build/compat.d.ts +0 -1
  12. package/{src → dist/src}/executors/dev-server/compat.d.ts +0 -1
  13. package/{src → dist/src}/executors/dev-server/dev-server.impl.d.ts +0 -1
  14. package/{src → dist/src}/executors/dev-server/dev-server.impl.js +3 -35
  15. package/{src → dist/src}/executors/preview-server/compat.d.ts +0 -1
  16. package/{src → dist/src}/executors/preview-server/preview-server.impl.d.ts +0 -1
  17. package/{src → dist/src}/executors/preview-server/preview-server.impl.js +3 -35
  18. package/{src → dist/src}/generators/configuration/configuration.d.ts +0 -1
  19. package/{src → dist/src}/generators/configuration/configuration.js +4 -2
  20. package/{src → dist/src}/generators/configuration/lib/convert-non-vite.d.ts +0 -1
  21. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
  22. package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +0 -1
  23. package/{src → dist/src}/generators/convert-to-inferred/lib/preview-post-target-transformer.d.ts +0 -1
  24. package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts +0 -1
  25. package/{src → dist/src}/generators/convert-to-inferred/lib/utils.d.ts +0 -1
  26. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  27. package/{src → dist/src}/generators/init/lib/utils.d.ts +0 -1
  28. package/dist/src/generators/setup-paths-plugin/lib/utils.d.ts +1 -0
  29. package/dist/src/generators/setup-paths-plugin/lib/utils.js +2 -0
  30. package/{src → dist/src}/generators/setup-paths-plugin/setup-paths-plugin.d.ts +0 -1
  31. package/{src → dist/src}/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.d.ts +0 -1
  32. package/dist/src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.md +12 -0
  33. package/{src → dist/src}/migrations/update-20-5-0/eslint-ignore-vite-temp-files.d.ts +0 -1
  34. package/dist/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.js +44 -0
  35. package/dist/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.md +45 -0
  36. package/{src → dist/src}/migrations/update-20-5-0/install-jiti.d.ts +0 -1
  37. package/dist/src/migrations/update-20-5-0/install-jiti.md +6 -0
  38. package/{src → dist/src}/migrations/update-20-5-0/update-resolve-conditions.d.ts +0 -1
  39. package/dist/src/migrations/update-20-5-0/update-resolve-conditions.md +42 -0
  40. package/dist/src/migrations/update-22-2-0/ai-instructions-for-vitest-4.md +725 -0
  41. package/{src → dist/src}/migrations/update-22-2-0/migrate-vitest-to-vitest-package.d.ts +0 -1
  42. package/dist/src/migrations/update-23-0-0/ai-instructions-for-vite-8.md +254 -0
  43. package/{src → dist/src}/migrations/update-23-0-0/ensure-vitest-package-migration.d.ts +0 -1
  44. package/dist/src/migrations/update-23-0-0/ensure-vitest-package-migration.md +18 -0
  45. package/{src → dist/src}/migrations/update-23-0-0/rename-rollup-options-to-rolldown-options.d.ts +0 -1
  46. package/dist/src/migrations/update-23-0-0/rename-rollup-options-to-rolldown-options.js +47 -0
  47. package/dist/src/migrations/update-23-0-0/rename-rollup-options-to-rolldown-options.md +65 -0
  48. package/{src → dist/src}/plugins/plugin.d.ts +0 -1
  49. package/{src → dist/src}/utils/deprecation.d.ts +0 -1
  50. package/{src → dist/src}/utils/detect-ui-framework.d.ts +0 -1
  51. package/{src → dist/src}/utils/e2e-web-server-info-utils.d.ts +0 -1
  52. package/{src → dist/src}/utils/ensure-dependencies.d.ts +0 -1
  53. package/{src → dist/src}/utils/executor-utils.d.ts +0 -1
  54. package/{src → dist/src}/utils/find-vite-config.d.ts +0 -1
  55. package/{src → dist/src}/utils/generator-utils.d.ts +1 -2
  56. package/{src → dist/src}/utils/generator-utils.js +4 -4
  57. package/{src → dist/src}/utils/ignore-vite-temp-files.d.ts +0 -1
  58. package/{src → dist/src}/utils/ignore-vite-temp-files.js +7 -35
  59. package/{src → dist/src}/utils/nx-tsconfig-paths-find-file.d.ts +0 -1
  60. package/{src → dist/src}/utils/options-utils.d.ts +0 -1
  61. package/{src → dist/src}/utils/test-files/test-vite-configs.d.ts +3 -4
  62. package/{src → dist/src}/utils/test-files/test-vite-configs.js +3 -3
  63. package/{src → dist/src}/utils/version-utils.d.ts +0 -1
  64. package/{src → dist/src}/utils/versions.d.ts +0 -1
  65. package/{src → dist/src}/utils/versions.js +2 -1
  66. package/{src → dist/src}/utils/vite-config-edit-utils.d.ts +0 -1
  67. package/executors.json +12 -12
  68. package/generators.json +8 -8
  69. package/migrations.json +10 -10
  70. package/package.json +73 -28
  71. package/executors.d.ts.map +0 -1
  72. package/index.d.ts.map +0 -1
  73. package/plugin.d.ts.map +0 -1
  74. package/plugins/nx-copy-assets.plugin.d.ts.map +0 -1
  75. package/plugins/nx-tsconfig-paths.plugin.d.ts.map +0 -1
  76. package/plugins/nx-vite-build-coordination.plugin.d.ts.map +0 -1
  77. package/plugins/rollup-replace-files.plugin.d.ts.map +0 -1
  78. package/src/executors/build/build.impl.d.ts.map +0 -1
  79. package/src/executors/build/compat.d.ts.map +0 -1
  80. package/src/executors/dev-server/compat.d.ts.map +0 -1
  81. package/src/executors/dev-server/dev-server.impl.d.ts.map +0 -1
  82. package/src/executors/preview-server/compat.d.ts.map +0 -1
  83. package/src/executors/preview-server/preview-server.impl.d.ts.map +0 -1
  84. package/src/generators/configuration/configuration.d.ts.map +0 -1
  85. package/src/generators/configuration/lib/convert-non-vite.d.ts.map +0 -1
  86. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
  87. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +0 -1
  88. package/src/generators/convert-to-inferred/lib/preview-post-target-transformer.d.ts.map +0 -1
  89. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts.map +0 -1
  90. package/src/generators/convert-to-inferred/lib/utils.d.ts.map +0 -1
  91. package/src/generators/init/init.d.ts.map +0 -1
  92. package/src/generators/init/lib/utils.d.ts.map +0 -1
  93. package/src/generators/setup-paths-plugin/lib/utils.d.ts +0 -1
  94. package/src/generators/setup-paths-plugin/lib/utils.d.ts.map +0 -1
  95. package/src/generators/setup-paths-plugin/lib/utils.js +0 -0
  96. package/src/generators/setup-paths-plugin/setup-paths-plugin.d.ts.map +0 -1
  97. package/src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.d.ts.map +0 -1
  98. package/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.d.ts.map +0 -1
  99. package/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.js +0 -76
  100. package/src/migrations/update-20-5-0/install-jiti.d.ts.map +0 -1
  101. package/src/migrations/update-20-5-0/update-resolve-conditions.d.ts.map +0 -1
  102. package/src/migrations/update-22-2-0/migrate-vitest-to-vitest-package.d.ts.map +0 -1
  103. package/src/migrations/update-23-0-0/ensure-vitest-package-migration.d.ts.map +0 -1
  104. package/src/migrations/update-23-0-0/rename-rollup-options-to-rolldown-options.d.ts.map +0 -1
  105. package/src/migrations/update-23-0-0/rename-rollup-options-to-rolldown-options.js +0 -36
  106. package/src/plugins/plugin.d.ts.map +0 -1
  107. package/src/utils/deprecation.d.ts.map +0 -1
  108. package/src/utils/detect-ui-framework.d.ts.map +0 -1
  109. package/src/utils/e2e-web-server-info-utils.d.ts.map +0 -1
  110. package/src/utils/ensure-dependencies.d.ts.map +0 -1
  111. package/src/utils/executor-utils.d.ts.map +0 -1
  112. package/src/utils/find-vite-config.d.ts.map +0 -1
  113. package/src/utils/generator-utils.d.ts.map +0 -1
  114. package/src/utils/ignore-vite-temp-files.d.ts.map +0 -1
  115. package/src/utils/nx-tsconfig-paths-find-file.d.ts.map +0 -1
  116. package/src/utils/options-utils.d.ts.map +0 -1
  117. package/src/utils/test-files/test-vite-configs.d.ts.map +0 -1
  118. package/src/utils/version-utils.d.ts.map +0 -1
  119. package/src/utils/versions.d.ts.map +0 -1
  120. package/src/utils/vite-config-edit-utils.d.ts.map +0 -1
  121. /package/{LICENSE → dist/LICENSE} +0 -0
  122. /package/{executors.js → dist/executors.js} +0 -0
  123. /package/{index.js → dist/index.js} +0 -0
  124. /package/{plugin.js → dist/plugin.js} +0 -0
  125. /package/{plugins → dist/plugins}/nx-copy-assets.plugin.js +0 -0
  126. /package/{plugins → dist/plugins}/nx-tsconfig-paths.plugin.js +0 -0
  127. /package/{plugins → dist/plugins}/nx-vite-build-coordination.plugin.js +0 -0
  128. /package/{plugins → dist/plugins}/rollup-replace-files.plugin.js +0 -0
  129. /package/{src → dist/src}/executors/build/compat.js +0 -0
  130. /package/{src → dist/src}/executors/build/schema.d.ts +0 -0
  131. /package/{src → dist/src}/executors/build/schema.json +0 -0
  132. /package/{src → dist/src}/executors/dev-server/compat.js +0 -0
  133. /package/{src → dist/src}/executors/dev-server/schema.d.ts +0 -0
  134. /package/{src → dist/src}/executors/dev-server/schema.json +0 -0
  135. /package/{src → dist/src}/executors/preview-server/compat.js +0 -0
  136. /package/{src → dist/src}/executors/preview-server/schema.d.ts +0 -0
  137. /package/{src → dist/src}/executors/preview-server/schema.json +0 -0
  138. /package/{src → dist/src}/generators/configuration/lib/convert-non-vite.js +0 -0
  139. /package/{src → dist/src}/generators/configuration/schema.d.ts +0 -0
  140. /package/{src → dist/src}/generators/configuration/schema.json +0 -0
  141. /package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +0 -0
  142. /package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.js +0 -0
  143. /package/{src → dist/src}/generators/convert-to-inferred/lib/preview-post-target-transformer.js +0 -0
  144. /package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-transformer.js +0 -0
  145. /package/{src → dist/src}/generators/convert-to-inferred/lib/utils.js +0 -0
  146. /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
  147. /package/{src → dist/src}/generators/init/init.js +0 -0
  148. /package/{src → dist/src}/generators/init/lib/utils.js +0 -0
  149. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  150. /package/{src → dist/src}/generators/init/schema.json +0 -0
  151. /package/{src → dist/src}/generators/setup-paths-plugin/schema.d.ts +0 -0
  152. /package/{src → dist/src}/generators/setup-paths-plugin/schema.json +0 -0
  153. /package/{src → dist/src}/generators/setup-paths-plugin/setup-paths-plugin.js +0 -0
  154. /package/{src → dist/src}/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.js +0 -0
  155. /package/{src → dist/src}/migrations/update-20-5-0/install-jiti.js +0 -0
  156. /package/{src → dist/src}/migrations/update-20-5-0/update-resolve-conditions.js +0 -0
  157. /package/{src → dist/src}/migrations/update-22-2-0/migrate-vitest-to-vitest-package.js +0 -0
  158. /package/{src → dist/src}/migrations/update-23-0-0/ensure-vitest-package-migration.js +0 -0
  159. /package/{src → dist/src}/plugins/plugin.js +0 -0
  160. /package/{src → dist/src}/utils/deprecation.js +0 -0
  161. /package/{src → dist/src}/utils/detect-ui-framework.js +0 -0
  162. /package/{src → dist/src}/utils/e2e-web-server-info-utils.js +0 -0
  163. /package/{src → dist/src}/utils/ensure-dependencies.js +0 -0
  164. /package/{src → dist/src}/utils/executor-utils.js +0 -0
  165. /package/{src → dist/src}/utils/find-vite-config.js +0 -0
  166. /package/{src → dist/src}/utils/nx-tsconfig-paths-find-file.js +0 -0
  167. /package/{src → dist/src}/utils/options-utils.js +0 -0
  168. /package/{src → dist/src}/utils/version-utils.js +0 -0
  169. /package/{src → dist/src}/utils/vite-config-edit-utils.js +0 -0
@@ -9,4 +9,3 @@ import { type GeneratorCallback, type Tree } from '@nx/devkit';
9
9
  * 4. Migrates targetDefaults from @nx/vite:test to @nx/vitest:test
10
10
  */
11
11
  export default function migrateVitestToVitestPackage(tree: Tree): Promise<GeneratorCallback>;
12
- //# sourceMappingURL=migrate-vitest-to-vitest-package.d.ts.map
@@ -0,0 +1,254 @@
1
+ # Vite 8 Migration Instructions for LLM
2
+
3
+ ## Overview
4
+
5
+ These instructions guide you through migrating an Nx workspace from Vite 7 to Vite 8. Vite 8 swaps Rollup for Rolldown as its bundler and updates a number of plugin APIs. Work through each section in order and run tests after each change.
6
+
7
+ ## Pre-Migration Checklist
8
+
9
+ 1. **Identify all Vite-using projects**:
10
+
11
+ ```bash
12
+ nx show projects --with-target build
13
+ nx show projects --with-target serve
14
+ ```
15
+
16
+ 2. **Locate all Vite configuration files**:
17
+ - Search for `vite.config.{ts,js,mts,mjs,cts,cjs}`
18
+ - Check `project.json` files for inline Vite-related options
19
+
20
+ 3. **Cypress Component Testing**: Cypress >= 15.14.0 supports Vite 8. The `nx migrate` step bumps Cypress automatically. If you have explicitly pinned Cypress below 15.14.0, upgrade it before bumping Vite.
21
+
22
+ ## Migration Steps by Category
23
+
24
+ ### 1. Rename `rollupOptions` to `rolldownOptions`
25
+
26
+ The `nx migrate` codemod handles this automatically for `vite.config.{ts,js,mts,mjs,cts,cjs}` files. If you have `rollupOptions` declared elsewhere (e.g., in helper modules imported by your config), rename them by hand.
27
+
28
+ **Search Pattern**: `rollupOptions` in any TypeScript/JavaScript file
29
+
30
+ ```typescript
31
+ // ❌ BEFORE (Vite 7)
32
+ export default defineConfig({
33
+ build: {
34
+ rollupOptions: {
35
+ external: ['react'],
36
+ output: { manualChunks: { vendor: ['react', 'react-dom'] } },
37
+ },
38
+ },
39
+ });
40
+
41
+ // ✅ AFTER (Vite 8)
42
+ export default defineConfig({
43
+ build: {
44
+ rolldownOptions: {
45
+ external: ['react'],
46
+ output: { manualChunks: { vendor: ['react', 'react-dom'] } },
47
+ },
48
+ },
49
+ });
50
+ ```
51
+
52
+ **Action Items**:
53
+
54
+ - [ ] Verify the codemod picked up every config file (`rg "rollupOptions"` should return zero hits inside vite configs)
55
+ - [ ] Rename any `rollupOptions` in helper modules or shared config builders
56
+ - [ ] Update CI scripts that parse `build.rollupOptions` (e.g., custom bundle-size assertions)
57
+
58
+ ### 2. `@vitejs/plugin-react` v6 (Oxc Replaces Babel)
59
+
60
+ `@vitejs/plugin-react@^6` is required for Vite 8 and uses [Oxc](https://oxc.rs/) instead of Babel for JSX transformation. The plugin's `babel` option is gone.
61
+
62
+ ```typescript
63
+ // ❌ BEFORE (Vite 7, plugin-react v4)
64
+ import react from '@vitejs/plugin-react';
65
+
66
+ export default defineConfig({
67
+ plugins: [
68
+ react({
69
+ babel: {
70
+ plugins: ['babel-plugin-styled-components'],
71
+ },
72
+ }),
73
+ ],
74
+ });
75
+
76
+ // ✅ AFTER (Vite 8, plugin-react v6)
77
+ import react from '@vitejs/plugin-react';
78
+
79
+ export default defineConfig({
80
+ plugins: [react()],
81
+ });
82
+ ```
83
+
84
+ **Action Items**:
85
+
86
+ - [ ] Remove `babel` options from `react()` plugin invocations
87
+ - [ ] If you depended on a Babel plugin (e.g., styled-components, emotion, relay), find an Oxc-compatible replacement or switch to `@vitejs/plugin-react-swc` (still Babel-free). There is no drop-in for arbitrary Babel plugins.
88
+ - [ ] If you cannot drop your Babel plugin, stay on Vite 7 + plugin-react v4 for now (see "Project-Level Vite 7 Pinning")
89
+ - [ ] Run `pnpm install` (or your package manager equivalent) so the new plugin-react version resolves
90
+
91
+ ### 3. Angular + Vitest (vitest-analog path): Add `@oxc-project/runtime`
92
+
93
+ Angular projects whose `test` target uses `@nx/vitest:test` (the vitest-analog setup wired by `@analogjs/vite-plugin-angular`) need `@oxc-project/runtime` declared in the workspace `devDependencies`.
94
+
95
+ `@analogjs/vite-plugin-angular` registers an `angularVitestPlugin` (active in test mode) whose `transform` hook matches `@angular/*` `fesm2022` modules that contain `async ` (plus any `@angular/cdk` file) and calls `vite.transformWithOxc(code, id, { target: 'es2016', … })`. The downlevel is deliberate: Zone.js relies on monkey-patching promise scheduling for `fakeAsync` and friends, which it cannot do on native `async`/`await`, so the plugin lowers them to a form Zone.js can intercept. With `target: 'es2016'`, oxc emits the helpers as external `@oxc-project/runtime/helpers/*` imports (oxc's default `HelperMode = 'Runtime'`). Nothing in the upstream chain (`analogjs`, `@angular/core`, `vite`, `rolldown`) declares `@oxc-project/runtime` in a way that's resolvable from the consumer's workspace, so `vite:import-analysis` fails to resolve those imports unless the dep is added explicitly.
96
+
97
+ Angular projects whose `test` target uses `@angular/build:unit-test` or `@nx/angular:unit-test` (the vitest-angular path) do **not** need this dependency — that path doesn't load `@analogjs/vite-plugin-angular`, sets `optimizeDeps.noDiscovery: true`, and uses an in-memory test provider, so the downlevel transform that emits the helper imports never runs.
98
+
99
+ **Search Pattern**: Projects with `test.executor` set to `@nx/vitest:test` that also have `@analogjs/vite-plugin-angular` in their `vite.config.*`.
100
+
101
+ ```bash
102
+ rg '"@nx/vitest:test"' --type json
103
+ rg '@analogjs/vite-plugin-angular' --type ts --type js
104
+ ```
105
+
106
+ **Action Items**:
107
+
108
+ - [ ] For each affected workspace, add `@oxc-project/runtime` to root `devDependencies` (the Nx Angular generators do this automatically on the vitest-analog path; check legacy workspaces that pre-date that)
109
+ - [ ] Run `pnpm install` (or equivalent)
110
+ - [ ] Run the project's tests to confirm the helper resolves
111
+
112
+ ### 4. Type Resolution Under `moduleResolution: "node"`
113
+
114
+ Vite 8 ships its types only via conditional `exports` (it dropped the top-level `types` field that Vite 7 carried), which TypeScript cannot resolve under `moduleResolution: "node"`. Symptoms include type errors on `defineConfig`, `UserConfig`, or plugin return types.
115
+
116
+ **Action Items**:
117
+
118
+ - [ ] Update affected `tsconfig*.json` files: `"moduleResolution": "bundler"` (recommended) or `"node16"`/`"nodenext"`
119
+ - [ ] If you cannot change `moduleResolution`, narrow the impact with explicit `as any` casts at vite imports. The Nx-generated configs already do this in a handful of places.
120
+ - [ ] Run `tsc --noEmit` after the change to confirm types resolve cleanly
121
+
122
+ ### 5. Bundle Validation Scripts
123
+
124
+ Rolldown produces different chunk and module counts than Rollup for the same input. Custom build validation (e.g., "bundle has exactly N chunks") will need to be re-baselined.
125
+
126
+ **Action Items**:
127
+
128
+ - [ ] Identify scripts that assert chunk/module counts or names
129
+ - [ ] Re-run the build and update expected values
130
+ - [ ] Prefer asserting on size budgets over exact counts going forward
131
+
132
+ ### 6. Project-Level Vite 7 Pinning (Custom Babel Plugins)
133
+
134
+ If a project depends on a Babel plugin that has no Oxc equivalent, pin that project to Vite 7.
135
+
136
+ ```jsonc
137
+ // package.json (workspace root)
138
+ {
139
+ "devDependencies": {
140
+ "vite": "^7.1.0",
141
+ "@vitejs/plugin-react": "^4.3.0",
142
+ },
143
+ }
144
+ ```
145
+
146
+ If only some projects need to stay on 7 while the rest move to 8, use your package manager's overrides feature:
147
+
148
+ - pnpm: `pnpm.overrides` in root `package.json`
149
+ - npm/yarn: `overrides`/`resolutions`
150
+
151
+ **Action Items**:
152
+
153
+ - [ ] Document which projects are pinned to Vite 7 and why
154
+ - [ ] Track Oxc plugin equivalents so you can unpin later
155
+
156
+ ## Post-Migration Validation
157
+
158
+ ### 1. Run Tests Per Project
159
+
160
+ ```bash
161
+ nx run-many -t test -p PROJECT_NAME
162
+ ```
163
+
164
+ ### 2. Build All Affected Projects
165
+
166
+ ```bash
167
+ nx affected -t build
168
+ ```
169
+
170
+ ### 3. Validate Dev Server
171
+
172
+ ```bash
173
+ nx serve PROJECT_NAME
174
+ ```
175
+
176
+ Open the app and verify HMR still works for changes in source files.
177
+
178
+ ### 4. Validate CI Pipeline
179
+
180
+ ```bash
181
+ nx prepush
182
+ ```
183
+
184
+ ### 5. Review Migration Checklist
185
+
186
+ - [ ] All `rollupOptions` references renamed to `rolldownOptions`
187
+ - [ ] `@vitejs/plugin-react` upgraded to v6 (or pinned to v4 with a documented reason)
188
+ - [ ] No `babel: { ... }` options remain in `react()` calls (or those projects are pinned to Vite 7)
189
+ - [ ] Angular + vitest-analog projects have `@oxc-project/runtime` in root `devDependencies`
190
+ - [ ] Cypress upgraded by `nx migrate` (>= 15.14.0 for Vite 8 support)
191
+ - [ ] `tsc --noEmit` passes on all affected projects
192
+ - [ ] Build, test, and dev-server commands all succeed
193
+
194
+ ## Common Issues and Solutions
195
+
196
+ ### Issue: `Cannot find name 'rollupOptions'` or build options ignored
197
+
198
+ **Solution**: Rename to `rolldownOptions`. Vite 8 still accepts `rollupOptions` as a deprecated alias (it copies the value to `rolldownOptions` and logs a deprecation warning), but mixing both at the same level may cause precedence surprises (`rolldownOptions` wins).
199
+
200
+ ### Issue: Babel plugin no longer applied (e.g., styled-components classNames missing)
201
+
202
+ **Solution**: `@vitejs/plugin-react@6` removed Babel. Find an Oxc-compatible alternative, switch to `@vitejs/plugin-react-swc`, or pin to Vite 7 + plugin-react v4.
203
+
204
+ ### Issue: Angular + Vitest fails with `Failed to resolve import "@oxc-project/runtime/helpers/..."`
205
+
206
+ **Solution**: Add `@oxc-project/runtime` to root `devDependencies` and reinstall. This only affects projects whose `test` target uses `@nx/vitest:test` (the vitest-analog setup); projects using `@angular/build:unit-test` / `@nx/angular:unit-test` are not affected.
207
+
208
+ ### Issue: Type errors on `defineConfig`, `UserConfig`, or `Plugin` imports from vite
209
+
210
+ **Solution**: Set `moduleResolution: "bundler"` in your tsconfig (or `nodenext` if you need Node-style resolution).
211
+
212
+ ### Issue: Cypress CT fails to start under Vite 8
213
+
214
+ **Solution**: Confirm `cypress >= 15.14.0` is installed (Vite 8 support landed in that release). `nx migrate` bumps Cypress automatically; if you pinned it lower in `package.json`, remove the pin and reinstall.
215
+
216
+ ### Issue: Bundle-size or chunk-count assertions fail after upgrade
217
+
218
+ **Solution**: Rolldown chunks differently than Rollup. Re-baseline expected values.
219
+
220
+ ## Files to Review
221
+
222
+ ```bash
223
+ # Vite config files
224
+ find . -name "vite.config.*" -not -path "*/node_modules/*"
225
+
226
+ # Cypress component testing setup
227
+ rg "@nx/(angular|react|next|remix)/plugins/component-testing"
228
+
229
+ # Babel plugin usage in plugin-react
230
+ rg "@vitejs/plugin-react.*babel|babel:\s*\{" --type ts --type js
231
+
232
+ # Angular projects with Vitest
233
+ rg "@angular/build" -l package.json
234
+ ```
235
+
236
+ ## Guard Rails
237
+
238
+ DO NOT
239
+
240
+ - Force tests to pass by removing assertions or replacing them with `expect(true).toBe(true)`
241
+ - Strip `react()` plugin options without finding an equivalent for what they did
242
+ - Roll Cypress back below 15.14.0 after the migrate. Older Cypress fails to start under Vite 8.
243
+
244
+ ---
245
+
246
+ ## Notes for LLM Execution
247
+
248
+ When executing this migration:
249
+
250
+ 1. **Work systematically**: Complete one category before moving to the next
251
+ 2. **Test after each change**: Build and test affected projects after each step
252
+ 3. **Keep user informed**: Report which categories applied and which were skipped
253
+ 4. **Use TodoWrite tool**: Track migration progress for visibility
254
+ 5. **Stop and ask** if a project depends on a Babel plugin with no Oxc equivalent. Pinning to Vite 7 is a workspace decision.
@@ -1,3 +1,2 @@
1
1
  import { type GeneratorCallback, type Tree } from '@nx/devkit';
2
2
  export default function ensureVitestPackageMigration(tree: Tree): Promise<GeneratorCallback>;
3
- //# sourceMappingURL=ensure-vitest-package-migration.d.ts.map
@@ -0,0 +1,18 @@
1
+ # ensure-vitest-package-migration (Nx v23)
2
+
3
+ Migration that runs automatically when upgrading to Nx 23. It is a safety net for workspaces that still have `@nx/vite` vitest artifacts in place after the optional v22 migration.
4
+
5
+ ## What it does
6
+
7
+ 1. **Installs `@nx/vitest`**: added to `devDependencies` when vitest is detected in the workspace (skipped when already present or when the workspace does not use vitest at all).
8
+ 2. **Swaps `@nx/vite:test` to `@nx/vitest:test`**: updates every `project.json` target and every `targetDefaults` entry that still references the removed executor.
9
+ 3. **Splits `@nx/vite/plugin` registrations**: vitest-related options (`testTargetName`, `ciTargetName`, `ciGroupName`) are extracted from each `@nx/vite/plugin` entry and moved to a new `@nx/vitest` plugin entry. The vite entry is updated to retain only build/serve/preview options.
10
+ 4. **Registers `@nx/vitest` plugin**: for workspaces that used `@nx/vite/plugin` in its default configuration (no vitest options), a matching `@nx/vitest` plugin entry is added automatically so vitest targets continue to be inferred.
11
+
12
+ ## Why this migration exists
13
+
14
+ The vitest support that previously lived in `@nx/vite` (the `@nx/vite:test` executor, the `@nx/vite:vitest` generator, and the vitest target inference in `@nx/vite/plugin`) was removed in Nx 23 and is now exclusively provided by the `@nx/vitest` package. See the [Migrating from @nx/vite guide](/technologies/test-tools/vitest/guides/migrating-from-nx-vite).
15
+
16
+ ## No action required
17
+
18
+ Run `nx migrate` and this migration will handle the conversion automatically. To verify the result, check `nx.json`, your `project.json` files, and `package.json` after running migrations.
@@ -1,3 +1,2 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  export default function renameRollupOptionsToRolldownOptions(tree: Tree): Promise<void>;
3
- //# sourceMappingURL=rename-rollup-options-to-rolldown-options.d.ts.map
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = renameRollupOptionsToRolldownOptions;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const tsquery_1 = require("@phenomnomnominal/tsquery");
6
+ const picomatch = require("picomatch");
7
+ // Matches both bare-key form (rollupOptions: ...) and quoted-key form
8
+ // ('rollupOptions': ...) so configs written with JSON-style quoting are caught.
9
+ const ROLLUP_OPTIONS_SELECTOR = 'PropertyAssignment > :matches(Identifier[name=rollupOptions], StringLiteral[value=rollupOptions])';
10
+ const VITE_CONFIG_GLOB = '**/vite.*config*.{js,ts,mjs,mts,cjs,cts}';
11
+ async function renameRollupOptionsToRolldownOptions(tree) {
12
+ const matchVite = picomatch(VITE_CONFIG_GLOB);
13
+ (0, devkit_1.visitNotIgnoredFiles)(tree, '', (filePath) => {
14
+ if (!matchVite(filePath)) {
15
+ return;
16
+ }
17
+ const contents = tree.read(filePath, 'utf-8');
18
+ if (!contents)
19
+ return;
20
+ if (!contents.includes('rollupOptions')) {
21
+ return;
22
+ }
23
+ const sourceFile = (0, tsquery_1.ast)(contents);
24
+ // Extra .text filter guards against the outer-PropertyAssignment descendant
25
+ // trap: ensures the matched node's own name is `rollupOptions`, not a
26
+ // nested node that merely contains an identifier with that name.
27
+ const nodes = (0, tsquery_1.query)(sourceFile, ROLLUP_OPTIONS_SELECTOR).filter((node) => node.text === 'rollupOptions');
28
+ if (nodes.length === 0) {
29
+ return;
30
+ }
31
+ // Replace from end-to-start so positions stay valid as we mutate.
32
+ let updated = contents;
33
+ for (let i = nodes.length - 1; i >= 0; i--) {
34
+ const node = nodes[i];
35
+ const start = node.getStart();
36
+ const end = node.getEnd();
37
+ // Preserve quote style for StringLiteral keys ('rollupOptions' or "rollupOptions").
38
+ const quoteChar = updated[start];
39
+ const replacement = quoteChar === "'" || quoteChar === '"'
40
+ ? `${quoteChar}rolldownOptions${quoteChar}`
41
+ : 'rolldownOptions';
42
+ updated = updated.slice(0, start) + replacement + updated.slice(end);
43
+ }
44
+ tree.write(filePath, updated);
45
+ });
46
+ await (0, devkit_1.formatFiles)(tree);
47
+ }
@@ -0,0 +1,65 @@
1
+ #### Rename `rollupOptions` to `rolldownOptions` in Vite Config Files
2
+
3
+ Renames the `rollupOptions` property to `rolldownOptions` inside `vite.config.{js,ts,mjs,mts,cjs,cts}` files. [Vite 8 replaced Rollup with Rolldown](https://vite.dev/blog/announcing-vite8) as its production bundler; `rollupOptions` is accepted as a deprecated alias but logs a warning and may produce precedence surprises when both keys are present. The migration covers top-level usage as well as nested `environments.<env>.build.rollupOptions`.
4
+
5
+ The migration only touches files matching `vite.*config*.{js,ts,mjs,mts,cjs,cts}`. Helper modules imported by your config and `rollupOptions` declared elsewhere need to be renamed by hand.
6
+
7
+ #### Sample Code Changes
8
+
9
+ Top-level rename inside `build`.
10
+
11
+ ##### Before
12
+
13
+ ```ts title="apps/myapp/vite.config.ts" {3}
14
+ export default defineConfig({
15
+ build: {
16
+ rollupOptions: {
17
+ external: ['react'],
18
+ },
19
+ },
20
+ });
21
+ ```
22
+
23
+ ##### After
24
+
25
+ ```ts title="apps/myapp/vite.config.ts"
26
+ export default defineConfig({
27
+ build: {
28
+ rolldownOptions: {
29
+ external: ['react'],
30
+ },
31
+ },
32
+ });
33
+ ```
34
+
35
+ The same rename applies inside `environments.<env>.build`.
36
+
37
+ ##### Before
38
+
39
+ ```ts title="apps/myapp/vite.config.ts" {5}
40
+ export default defineConfig({
41
+ environments: {
42
+ ssr: {
43
+ build: {
44
+ rollupOptions: { external: ['fs'] },
45
+ },
46
+ },
47
+ },
48
+ });
49
+ ```
50
+
51
+ ##### After
52
+
53
+ ```ts title="apps/myapp/vite.config.ts"
54
+ export default defineConfig({
55
+ environments: {
56
+ ssr: {
57
+ build: {
58
+ rolldownOptions: { external: ['fs'] },
59
+ },
60
+ },
61
+ },
62
+ });
63
+ ```
64
+
65
+ > **Note**: Rolldown is largely Rollup-compatible but a handful of options have different semantics. The most common one to check after this migration: `output.manualChunks` only accepts a function in Rolldown (the object-of-globs form is invalid). See `tools/ai-migrations/MIGRATE_VITE_8.md` (created by a sibling migration) for the full Vite 8 upgrade checklist.
@@ -25,4 +25,3 @@ export interface VitePluginOptions {
25
25
  export declare const createDependencies: CreateDependencies;
26
26
  export declare const createNodes: CreateNodesV2<VitePluginOptions>;
27
27
  export declare const createNodesV2: CreateNodesV2<VitePluginOptions>;
28
- //# sourceMappingURL=plugin.d.ts.map
@@ -5,4 +5,3 @@ export declare function warnViteBuildExecutorDeprecation(): void;
5
5
  export declare function warnViteDevServerExecutorDeprecation(): void;
6
6
  export declare function warnVitePreviewServerExecutorDeprecation(): void;
7
7
  export declare function warnViteExecutorGenerating(): void;
8
- //# sourceMappingURL=deprecation.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function detectUiFramework(project: string): Promise<'angular' | 'react' | 'none'>;
2
- //# sourceMappingURL=detect-ui-framework.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  export declare function getViteE2EWebServerInfo(tree: Tree, projectName: string, configFilePath: string, isPluginBeingAdded: boolean, e2ePortOverride?: number, e2eCIPortOverride?: number): Promise<import("@nx/devkit/internal").E2EWebServerDetails>;
3
3
  export declare function getReactRouterE2EWebServerInfo(tree: Tree, projectName: string, configFilePath: string, isPluginBeingAdded: boolean, e2ePortOverride?: number, e2eCIPortOverride?: number): Promise<import("@nx/devkit/internal").E2EWebServerDetails>;
4
- //# sourceMappingURL=e2e-web-server-info-utils.d.ts.map
@@ -5,4 +5,3 @@ export type EnsureDependenciesOptions = {
5
5
  includeLib?: boolean;
6
6
  };
7
7
  export declare function ensureDependencies(host: Tree, schema: EnsureDependenciesOptions): GeneratorCallback;
8
- //# sourceMappingURL=ensure-dependencies.d.ts.map
@@ -9,4 +9,3 @@ export declare function createBuildableTsConfig(projectRoot: string, options: {
9
9
  buildLibsFromSource?: boolean;
10
10
  }, context: ExecutorContext): string;
11
11
  export declare function loadViteDynamicImport(): Promise<typeof import("vite")>;
12
- //# sourceMappingURL=executor-utils.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  export declare function findViteConfig(tree: Tree, searchRoot: string): string;
3
3
  export declare function findWebpackConfig(tree: Tree, searchRoot: string): string;
4
- //# sourceMappingURL=find-vite-config.d.ts.map
@@ -29,7 +29,7 @@ export interface ViteConfigFileOptions {
29
29
  includeVitest?: boolean;
30
30
  inSourceTests?: boolean;
31
31
  testEnvironment?: 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime' | string;
32
- rollupOptionsExternal?: string[];
32
+ rolldownOptionsExternal?: string[];
33
33
  imports?: string[];
34
34
  plugins?: string[];
35
35
  coverageProvider?: 'v8' | 'istanbul' | 'custom';
@@ -43,4 +43,3 @@ export declare function normalizeViteConfigFilePathWithTree(tree: Tree, projectR
43
43
  export declare function getViteConfigPathForProject(tree: Tree, projectName: string, target?: string): string;
44
44
  export declare function handleUnsupportedUserProvidedTargets(userProvidedTargetIsUnsupported: TargetFlags, userProvidedTargetName: UserProvidedTargetName, validFoundTargetName: ValidFoundTargetName): Promise<void>;
45
45
  export declare function handleUnknownConfiguration(projectName: string): Promise<void>;
46
- //# sourceMappingURL=generator-utils.d.ts.map
@@ -271,9 +271,9 @@ function createOrEditViteConfig(tree, options, onlyVitest, projectAlreadyHasVite
271
271
  // Don't forget to update your package.json as well.
272
272
  formats: ['es' as const]
273
273
  },
274
- rollupOptions: {
274
+ rolldownOptions: {
275
275
  // External packages that should not be bundled into your library.
276
- external: [${options.rollupOptionsExternal ?? ''}]
276
+ external: [${options.rolldownOptionsExternal ?? ''}]
277
277
  },
278
278
  },`
279
279
  : ` build: {
@@ -470,8 +470,8 @@ function handleViteConfigFileExists(tree, viteConfigPath, options, buildOption,
470
470
  fileName: 'index',
471
471
  formats: ['es'],
472
472
  },
473
- rollupOptions: {
474
- external: options.rollupOptionsExternal ?? [],
473
+ rolldownOptions: {
474
+ external: options.rolldownOptionsExternal ?? [],
475
475
  },
476
476
  outDir: buildOutDir,
477
477
  reportCompressedSize: true,
@@ -2,4 +2,3 @@ import { type Tree } from '@nx/devkit';
2
2
  export declare function ignoreViteTempFiles(tree: Tree, projectRoot?: string | undefined): Promise<void>;
3
3
  export declare function addViteTempFilesToGitIgnore(tree: Tree): void;
4
4
  export declare function isEslintInstalled(tree: Tree): boolean;
5
- //# sourceMappingURL=ignore-vite-temp-files.d.ts.map
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.ignoreViteTempFiles = ignoreViteTempFiles;
37
4
  exports.addViteTempFilesToGitIgnore = addViteTempFilesToGitIgnore;
@@ -57,11 +24,16 @@ async function ignoreViteTempFilesInEslintConfig(tree, projectRoot) {
57
24
  return;
58
25
  }
59
26
  (0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
60
- const { addIgnoresToLintConfig, isEslintConfigSupported } = await Promise.resolve().then(() => __importStar(require('@nx/eslint/internal')));
27
+ // Use CommonJS `require` rather than a dynamic ESM `import`: `ensurePackage`
28
+ // makes the on-demand-installed package available via `Module._initPaths`,
29
+ // which `require()` honors but ESM resolution does not. Under nodenext, a
30
+ // dynamic `import()` is preserved as a true ESM dynamic import, so it can't
31
+ // see the temp install — generators that go down this path crash with
32
+ // `Cannot find package '@nx/eslint'`.
33
+ const { addIgnoresToLintConfig, isEslintConfigSupported, useFlatConfig, } = require('@nx/eslint/internal');
61
34
  if (!isEslintConfigSupported(tree)) {
62
35
  return;
63
36
  }
64
- const { useFlatConfig } = await Promise.resolve().then(() => __importStar(require('@nx/eslint/internal')));
65
37
  const isUsingFlatConfig = useFlatConfig(tree);
66
38
  if (!projectRoot && !isUsingFlatConfig) {
67
39
  // root eslintrc files ignore all files and the root eslintrc files add
@@ -1,3 +1,2 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  export declare function findFile(path: string, extensions: string[], existsSyncImpl?: typeof existsSync): string;
3
- //# sourceMappingURL=nx-tsconfig-paths-find-file.d.ts.map
@@ -15,4 +15,3 @@ export declare function getViteServerProxyConfigPath(nxProxyConfig: string | und
15
15
  export declare function getViteServerOptions(options: ViteDevServerExecutorOptions, context: ExecutorContext): Promise<Record<string, unknown>>;
16
16
  export declare function getProxyConfig(context: ExecutorContext, proxyConfig?: string): Record<string, string | unknown> | undefined;
17
17
  export declare function getNxTargetOptions(target: string, context: ExecutorContext): any;
18
- //# sourceMappingURL=options-utils.d.ts.map
@@ -5,8 +5,8 @@ export declare const conditionalConfig = "\n /// <reference types=\"vitest\"
5
5
  export declare const configNoDefineConfig = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default {\n plugins: [\n react(),\n nxViteTsPaths(),\n ],\n };\n ";
6
6
  export declare const noBuildOptionsHasTestOption = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default defineConfig({\n \n cacheDir: '../../node_modules/.vitest',\n plugins: [\n react(),\n nxViteTsPaths(),\n ],\n\n test: {\n globals: true,\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n\n });\n ";
7
7
  export declare const someBuildOptionsSomeTestOption = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default defineConfig({\n plugins: [\n react(),\n nxViteTsPaths(),\n ],\n\n test: {\n my: 'option',\n },\n\n build: {\n my: 'option',\n }\n\n });\n ";
8
- export declare const hasEverything = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n import dts from 'vite-plugin-dts';\n import { joinPathFragments } from '@nx/devkit';\n\n export default defineConfig({\n cacheDir: '../../node_modules/.vitest',\n plugins: [\n dts({ entryRoot: 'src', tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'), skipDiagnostics: true }),\n react(),\n nxViteTsPaths(),\n ],\n \n // Configuration for building your library.\n // See: https://vite.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'pure-libs-react-vite',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es'],\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime'],\n },\n },\n \n test: {\n globals: true,\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n ";
9
- export declare const buildOption = "\n // Configuration for building your library.\n // See: https://vite.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'my-app',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es']\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime']\n }\n },";
8
+ export declare const hasEverything = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n import dts from 'vite-plugin-dts';\n import { joinPathFragments } from '@nx/devkit';\n\n export default defineConfig({\n cacheDir: '../../node_modules/.vitest',\n plugins: [\n dts({ entryRoot: 'src', tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'), skipDiagnostics: true }),\n react(),\n nxViteTsPaths(),\n ],\n \n // Configuration for building your library.\n // See: https://vite.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'pure-libs-react-vite',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es'],\n },\n rolldownOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime'],\n },\n },\n \n test: {\n globals: true,\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n ";
9
+ export declare const buildOption = "\n // Configuration for building your library.\n // See: https://vite.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'my-app',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es']\n },\n rolldownOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime']\n }\n },";
10
10
  export declare const buildOptionObject: {
11
11
  lib: {
12
12
  entry: string;
@@ -14,7 +14,7 @@ export declare const buildOptionObject: {
14
14
  fileName: string;
15
15
  formats: string[];
16
16
  };
17
- rollupOptions: {
17
+ rolldownOptions: {
18
18
  external: string[];
19
19
  };
20
20
  };
@@ -26,4 +26,3 @@ export declare const testOptionObject: {
26
26
  };
27
27
  export declare const imports: string[];
28
28
  export declare const plugins: string[];
29
- //# sourceMappingURL=test-vite-configs.d.ts.map
@@ -157,7 +157,7 @@ exports.hasEverything = `
157
157
  // Don't forget to update your package.json as well.
158
158
  formats: ['es'],
159
159
  },
160
- rollupOptions: {
160
+ rolldownOptions: {
161
161
  // External packages that should not be bundled into your library.
162
162
  external: ['react', 'react-dom', 'react/jsx-runtime'],
163
163
  },
@@ -183,7 +183,7 @@ exports.buildOption = `
183
183
  // Don't forget to update your package.json as well.
184
184
  formats: ['es']
185
185
  },
186
- rollupOptions: {
186
+ rolldownOptions: {
187
187
  // External packages that should not be bundled into your library.
188
188
  external: ['react', 'react-dom', 'react/jsx-runtime']
189
189
  }
@@ -195,7 +195,7 @@ exports.buildOptionObject = {
195
195
  fileName: 'index',
196
196
  formats: ['es'],
197
197
  },
198
- rollupOptions: {
198
+ rolldownOptions: {
199
199
  external: ['react', 'react-dom', 'react/jsx-runtime'],
200
200
  },
201
201
  };
@@ -1,4 +1,3 @@
1
1
  import type { Tree } from 'nx/src/generators/tree';
2
2
  export declare function getInstalledViteVersion(tree: Tree): string | undefined;
3
3
  export declare function getInstalledViteMajorVersion(tree: Tree): 5 | 6 | 7 | 8 | undefined;
4
- //# sourceMappingURL=version-utils.d.ts.map
@@ -9,4 +9,3 @@ export declare const vitePluginReactSwcVersion = "^4.3.0";
9
9
  export declare const vitePluginDtsVersion = "~4.5.0";
10
10
  export declare const ajvVersion = "^8.0.0";
11
11
  export declare const jitiVersion = "2.4.2";
12
- //# sourceMappingURL=versions.d.ts.map
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jitiVersion = exports.ajvVersion = exports.vitePluginDtsVersion = exports.vitePluginReactSwcVersion = exports.vitePluginReactV4Version = exports.vitePluginReactVersion = exports.viteV5Version = exports.viteV6Version = exports.viteV7Version = exports.viteVersion = exports.nxVersion = void 0;
4
- exports.nxVersion = require('../../package.json').version;
4
+ const path_1 = require("path");
5
+ exports.nxVersion = require((0, path_1.join)('@nx/vite', 'package.json')).version;
5
6
  // Also update @nx/remix/utils/versions when changing vite version
6
7
  exports.viteVersion = '^8.0.0';
7
8
  exports.viteV7Version = '^7.0.0';