@nx/rspack 20.5.0-beta.1 → 20.5.0-beta.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rspack",
|
|
3
3
|
"description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.",
|
|
4
|
-
"version": "20.5.0-beta.
|
|
4
|
+
"version": "20.5.0-beta.2",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"generators": "./generators.json",
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nx/js": "20.5.0-beta.
|
|
28
|
-
"@nx/devkit": "20.5.0-beta.
|
|
29
|
-
"@nx/web": "20.5.0-beta.
|
|
30
|
-
"@nx/module-federation": "20.5.0-beta.
|
|
27
|
+
"@nx/js": "20.5.0-beta.2",
|
|
28
|
+
"@nx/devkit": "20.5.0-beta.2",
|
|
29
|
+
"@nx/web": "20.5.0-beta.2",
|
|
30
|
+
"@nx/module-federation": "20.5.0-beta.2",
|
|
31
31
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
32
32
|
"@rspack/core": "^1.1.5",
|
|
33
33
|
"@rspack/dev-server": "^1.0.9",
|
package/src/plugins/plugin.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createDependencies = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
6
5
|
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
7
6
|
const js_1 = require("@nx/js");
|
|
8
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
@@ -48,10 +47,22 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
48
47
|
!siblingFiles.includes('project.json')) {
|
|
49
48
|
return {};
|
|
50
49
|
}
|
|
50
|
+
let packageJson = {};
|
|
51
|
+
if (siblingFiles.includes('package.json')) {
|
|
52
|
+
packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(context.workspaceRoot, projectRoot, 'package.json'));
|
|
53
|
+
}
|
|
51
54
|
const normalizedOptions = normalizeOptions(options);
|
|
52
55
|
// We do not want to alter how the hash is calculated, so appending the config file path to the hash
|
|
53
56
|
// to prevent vite/vitest files overwriting the target cache created by the other
|
|
54
|
-
const
|
|
57
|
+
const nodeHash = (0, file_hasher_1.hashArray)([
|
|
58
|
+
...[
|
|
59
|
+
(0, path_1.join)(context.workspaceRoot, configFilePath),
|
|
60
|
+
(0, path_1.join)(context.workspaceRoot, (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))),
|
|
61
|
+
].map(file_hasher_1.hashFile),
|
|
62
|
+
(0, file_hasher_1.hashObject)(options),
|
|
63
|
+
(0, file_hasher_1.hashObject)(packageJson),
|
|
64
|
+
]);
|
|
65
|
+
const hash = `${nodeHash}_${configFilePath}`;
|
|
55
66
|
targetsCache[hash] ??= await createRspackTargets(configFilePath, projectRoot, normalizedOptions, context, isTsSolutionSetup);
|
|
56
67
|
const { targets, metadata } = targetsCache[hash];
|
|
57
68
|
return {
|
|
@@ -15,6 +15,7 @@ exports.determineMain = determineMain;
|
|
|
15
15
|
exports.determineTsConfig = determineTsConfig;
|
|
16
16
|
const devkit_1 = require("@nx/devkit");
|
|
17
17
|
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
18
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
18
19
|
const has_plugin_1 = require("./has-plugin");
|
|
19
20
|
function findExistingTargetsInProject(targets, userProvidedTargets) {
|
|
20
21
|
const output = {
|
|
@@ -129,11 +130,14 @@ function addOrChangeBuildTarget(tree, options, target) {
|
|
|
129
130
|
if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'src/assets'))) {
|
|
130
131
|
assets.push((0, devkit_1.joinPathFragments)(project.root, 'src/assets'));
|
|
131
132
|
}
|
|
133
|
+
const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
|
|
132
134
|
const buildOptions = {
|
|
133
135
|
target: options.target ?? 'web',
|
|
134
|
-
outputPath:
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
outputPath: isTsSolutionSetup
|
|
137
|
+
? (0, devkit_1.joinPathFragments)(project.root, 'dist')
|
|
138
|
+
: (0, devkit_1.joinPathFragments)('dist',
|
|
139
|
+
// If standalone project then use the project's name in dist.
|
|
140
|
+
project.root === '.' ? project.name : project.root),
|
|
137
141
|
index: (0, devkit_1.joinPathFragments)(project.root, 'src/index.html'),
|
|
138
142
|
main: determineMain(tree, options),
|
|
139
143
|
tsConfig: determineTsConfig(tree, options),
|