@nx/nuxt 18.2.0 → 18.2.2
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 +6 -6
- package/src/plugins/plugin.js +8 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nuxt",
|
|
3
|
-
"version": "18.2.
|
|
3
|
+
"version": "18.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nuxt plugin for Nx contains executors and generators for managing Nuxt applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"tslib": "^2.3.0",
|
|
32
32
|
"@nuxt/kit": "^3.10.0",
|
|
33
|
-
"@nx/devkit": "18.2.
|
|
34
|
-
"@nx/js": "18.2.
|
|
35
|
-
"@nx/eslint": "18.2.
|
|
36
|
-
"@nx/vue": "18.2.
|
|
37
|
-
"@nx/vite": "18.2.
|
|
33
|
+
"@nx/devkit": "18.2.2",
|
|
34
|
+
"@nx/js": "18.2.2",
|
|
35
|
+
"@nx/eslint": "18.2.2",
|
|
36
|
+
"@nx/vue": "18.2.2",
|
|
37
|
+
"@nx/vite": "18.2.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {},
|
|
40
40
|
"publishConfig": {
|
package/src/plugins/plugin.js
CHANGED
|
@@ -6,9 +6,9 @@ const path_1 = require("path");
|
|
|
6
6
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
7
7
|
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
-
const executor_utils_1 = require("../utils/executor-utils");
|
|
10
9
|
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
11
10
|
const js_1 = require("@nx/js");
|
|
11
|
+
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
12
12
|
const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'nuxt.hash');
|
|
13
13
|
const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
|
|
14
14
|
const calculatedTargets = {};
|
|
@@ -120,23 +120,17 @@ function buildStaticTarget(buildStaticTargetName, namedInputs, buildOutputs, pro
|
|
|
120
120
|
return targetConfig;
|
|
121
121
|
}
|
|
122
122
|
async function getInfoFromNuxtConfig(configFilePath, context, projectRoot) {
|
|
123
|
-
|
|
124
|
-
const config = await
|
|
125
|
-
cwd: (0, devkit_1.joinPathFragments)(context.workspaceRoot, projectRoot),
|
|
126
|
-
configFile: (0, path_1.basename)(configFilePath),
|
|
127
|
-
});
|
|
123
|
+
// TODO(Colum): Once plugins are isolated we can go back to @nuxt/kit since each plugin will be run in its own worker.
|
|
124
|
+
const config = await (0, config_utils_1.loadConfigFile)((0, path_1.join)(context.workspaceRoot, configFilePath));
|
|
128
125
|
return {
|
|
129
|
-
buildDir: config?.buildDir
|
|
126
|
+
buildDir: config?.buildDir ??
|
|
127
|
+
// Match .nuxt default build dir from '@nuxt/schema'
|
|
128
|
+
// See: https://github.com/nuxt/nuxt/blob/871404ae5673425aeedde82f123ea58aa7c6facf/packages/schema/src/config/common.ts#L117-L119
|
|
129
|
+
'.nuxt',
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
function getOutputs(nuxtConfig, projectRoot) {
|
|
133
|
-
|
|
134
|
-
if (nuxtConfig?.buildDir && (0, path_1.basename)(nuxtConfig?.buildDir) === '.nuxt') {
|
|
135
|
-
// if buildDir exists, it will be `something/something/.nuxt`
|
|
136
|
-
// we want the "general" outputPath to be `something/something`
|
|
137
|
-
nuxtBuildDir = nuxtConfig.buildDir.replace((0, path_1.basename)(nuxtConfig.buildDir), '');
|
|
138
|
-
}
|
|
139
|
-
const buildOutputPath = normalizeOutputPath(nuxtBuildDir, projectRoot);
|
|
133
|
+
const buildOutputPath = normalizeOutputPath(nuxtConfig?.buildDir, projectRoot);
|
|
140
134
|
return {
|
|
141
135
|
buildOutputs: [buildOutputPath],
|
|
142
136
|
};
|