@nx/vite 22.0.2 → 22.0.3
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.
- package/package.json +5 -5
- package/src/plugins/plugin.js +12 -0
- package/src/utils/test-utils.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vite",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for building and testing applications using Vite",
|
|
6
6
|
"repository": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"migrations": "./migrations.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nx/devkit": "22.0.
|
|
33
|
+
"@nx/devkit": "22.0.3",
|
|
34
34
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
35
35
|
"enquirer": "~2.3.6",
|
|
36
|
-
"@nx/js": "22.0.
|
|
36
|
+
"@nx/js": "22.0.3",
|
|
37
37
|
"picomatch": "4.0.2",
|
|
38
38
|
"tsconfig-paths": "^4.1.2",
|
|
39
39
|
"semver": "^7.6.3",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"ajv": "^8.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"nx": "22.0.
|
|
44
|
+
"nx": "22.0.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
48
|
-
"vitest": "^1.3.1 || ^2.0.0 || ^3.0.0"
|
|
48
|
+
"vitest": "^1.3.1 || ^2.0.0 || ^3.0.0 || ^4.0.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
package/src/plugins/plugin.js
CHANGED
|
@@ -104,6 +104,18 @@ async function buildViteTargets(configFilePath, projectRoot, options, tsConfigFi
|
|
|
104
104
|
catch {
|
|
105
105
|
// do nothing
|
|
106
106
|
}
|
|
107
|
+
// Workaround for race condition with ESM-only Vite plugins (e.g. @vitejs/plugin-vue@6+)
|
|
108
|
+
// If vite.config.ts is compiled as CJS, then when both require('@vitejs/plugin-vue') and import('@vitejs/plugin-vue')
|
|
109
|
+
// are pending in the same process, Node will throw an error:
|
|
110
|
+
// Error [ERR_INTERNAL_ASSERTION]: Cannot require() ES Module @vitejs/plugin-vue/dist/index.js because it is not yet fully loaded.
|
|
111
|
+
// This may be caused by a race condition if the module is simultaneously dynamically import()-ed via Promise.all().
|
|
112
|
+
try {
|
|
113
|
+
const importVuePlugin = () => new Function('return import("@vitejs/plugin-vue")')();
|
|
114
|
+
await importVuePlugin();
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// Plugin not installed or not needed, ignore
|
|
118
|
+
}
|
|
107
119
|
const { resolveConfig } = await (0, executor_utils_1.loadViteDynamicImport)();
|
|
108
120
|
const viteBuildConfig = await resolveConfig({
|
|
109
121
|
configFile: absoluteConfigFilePath,
|
package/src/utils/test-utils.js
CHANGED
|
@@ -162,7 +162,7 @@ function mockReactAppGenerator(tree, userAppName) {
|
|
|
162
162
|
"../../node_modules/@nx/react/typings/image.d.ts"
|
|
163
163
|
],
|
|
164
164
|
"exclude": [
|
|
165
|
-
"jest.config.
|
|
165
|
+
"jest.config.cts",
|
|
166
166
|
"**/*.spec.ts",
|
|
167
167
|
"**/*.test.ts",
|
|
168
168
|
"**/*.spec.tsx",
|
|
@@ -234,7 +234,7 @@ function mockReactMixedAppGenerator(tree) {
|
|
|
234
234
|
"../../node_modules/@nx/react/typings/image.d.ts"
|
|
235
235
|
],
|
|
236
236
|
"exclude": [
|
|
237
|
-
"jest.config.
|
|
237
|
+
"jest.config.cts",
|
|
238
238
|
"**/*.spec.ts",
|
|
239
239
|
"**/*.test.ts",
|
|
240
240
|
"**/*.spec.tsx",
|
|
@@ -452,7 +452,7 @@ function mockReactLibNonBuildableJestTestRunnerGenerator(tree) {
|
|
|
452
452
|
"../../node_modules/@nx/react/typings/image.d.ts"
|
|
453
453
|
],
|
|
454
454
|
"exclude": [
|
|
455
|
-
"jest.config.
|
|
455
|
+
"jest.config.cts",
|
|
456
456
|
"src/**/*.spec.ts",
|
|
457
457
|
"src/**/*.test.ts",
|
|
458
458
|
"src/**/*.spec.tsx",
|