@nx/rspack 24.1.0-beta.1 → 24.1.0-beta.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/dist/src/plugins/plugin.js +17 -8
- package/package.json +6 -6
|
@@ -22,8 +22,9 @@ exports.createNodes = [
|
|
|
22
22
|
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
23
23
|
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
24
24
|
const includePnpmMajorRuntimeInput = (0, internal_2.shouldIncludePnpmMajorRuntimeInput)(packageManager, context.workspaceRoot);
|
|
25
|
+
const includeBunInstallSettingsInputs = (0, internal_2.shouldIncludeBunInstallSettingsInputs)(packageManager, context.workspaceRoot);
|
|
25
26
|
try {
|
|
26
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, packageManager, pmc, lockFileName, includePnpmMajorRuntimeInput), configFilePaths, options, context);
|
|
27
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, packageManager, pmc, lockFileName, includePnpmMajorRuntimeInput, includeBunInstallSettingsInputs), configFilePaths, options, context);
|
|
27
28
|
}
|
|
28
29
|
finally {
|
|
29
30
|
targetsCache.writeToDisk();
|
|
@@ -34,7 +35,7 @@ exports.createNodes = [
|
|
|
34
35
|
* @deprecated Use {@link createNodes} instead. This will be removed in Nx 24.
|
|
35
36
|
*/
|
|
36
37
|
exports.createNodesV2 = exports.createNodes;
|
|
37
|
-
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, packageManager, pmc, lockFileName, includePnpmMajorRuntimeInput) {
|
|
38
|
+
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, packageManager, pmc, lockFileName, includePnpmMajorRuntimeInput, includeBunInstallSettingsInputs) {
|
|
38
39
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
39
40
|
// Do not create a project if package.json and project.json isn't there.
|
|
40
41
|
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
@@ -51,14 +52,19 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
51
52
|
const nodeHash = (0, devkit_1.hashArray)([
|
|
52
53
|
(0, internal_1.hashFile)((0, path_1.join)(context.workspaceRoot, configFilePath)),
|
|
53
54
|
lockFileHash,
|
|
54
|
-
(0, internal_1.hashObject)({
|
|
55
|
+
(0, internal_1.hashObject)({
|
|
56
|
+
...options,
|
|
57
|
+
isTsSolutionSetup,
|
|
58
|
+
includePnpmMajorRuntimeInput,
|
|
59
|
+
includeBunInstallSettingsInputs,
|
|
60
|
+
}),
|
|
55
61
|
(0, internal_1.hashObject)(packageJson),
|
|
56
62
|
]);
|
|
57
63
|
// We do not want to alter how the hash is calculated, so appending the config file path to the hash
|
|
58
64
|
// to prevent vite/vitest files overwriting the target cache created by the other
|
|
59
65
|
const hash = `${nodeHash}_${configFilePath}`;
|
|
60
66
|
if (!targetsCache.has(hash)) {
|
|
61
|
-
targetsCache.set(hash, await createRspackTargets(configFilePath, projectRoot, normalizedOptions, context, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput));
|
|
67
|
+
targetsCache.set(hash, await createRspackTargets(configFilePath, projectRoot, normalizedOptions, context, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput, includeBunInstallSettingsInputs));
|
|
62
68
|
}
|
|
63
69
|
const { targets, metadata } = targetsCache.get(hash);
|
|
64
70
|
return {
|
|
@@ -71,7 +77,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
71
77
|
},
|
|
72
78
|
};
|
|
73
79
|
}
|
|
74
|
-
async function createRspackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput) {
|
|
80
|
+
async function createRspackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput, includeBunInstallSettingsInputs) {
|
|
75
81
|
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
76
82
|
const rspackConfig = await (0, resolve_user_defined_rspack_config_1.resolveUserDefinedRspackConfig)((0, path_1.join)(context.workspaceRoot, configFilePath), (0, js_1.getRootTsConfigPath)(), true);
|
|
77
83
|
const rspackOptions = await (0, read_rspack_options_1.readRspackOptions)(rspackConfig);
|
|
@@ -116,12 +122,15 @@ async function createRspackTargets(configFilePath, projectRoot, options, context
|
|
|
116
122
|
dependsOn: [`^${options.buildTargetName}`],
|
|
117
123
|
inputs: [
|
|
118
124
|
...buildInputs,
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
//
|
|
125
|
+
// A dependency consumed as built is read from its build's outputs.
|
|
126
|
+
{ dependentTasksOutputFiles: '**/*', transitive: true },
|
|
127
|
+
// The build can emit a pruned pnpm or Bun deploy output
|
|
128
|
+
// (NxAppRspackPlugin with generatePackageJson), whose install settings
|
|
129
|
+
// come from these otherwise-unhashed root sources.
|
|
122
130
|
...(packageManager === 'pnpm'
|
|
123
131
|
? (0, internal_2.pnpmInstallSettingsInputsForInferredTarget)(includePnpmMajorRuntimeInput)
|
|
124
132
|
: []),
|
|
133
|
+
...(includeBunInstallSettingsInputs ? internal_2.BUN_INSTALL_SETTINGS_INPUTS : []),
|
|
125
134
|
],
|
|
126
135
|
outputs,
|
|
127
136
|
};
|
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": "24.1.0-beta.
|
|
4
|
+
"version": "24.1.0-beta.3",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -159,9 +159,9 @@
|
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
"dependencies": {
|
|
162
|
-
"@nx/devkit": "24.1.0-beta.
|
|
163
|
-
"@nx/js": "24.1.0-beta.
|
|
164
|
-
"@nx/web": "24.1.0-beta.
|
|
162
|
+
"@nx/devkit": "24.1.0-beta.3",
|
|
163
|
+
"@nx/js": "24.1.0-beta.3",
|
|
164
|
+
"@nx/web": "24.1.0-beta.3",
|
|
165
165
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
166
166
|
"autoprefixer": "^10.4.9",
|
|
167
167
|
"browserslist": "^4.26.0",
|
|
@@ -185,8 +185,8 @@
|
|
|
185
185
|
"webpack-node-externals": "^3.0.0"
|
|
186
186
|
},
|
|
187
187
|
"devDependencies": {
|
|
188
|
-
"nx": "24.1.0-beta.
|
|
189
|
-
"@nx/nest": "24.1.0-beta.
|
|
188
|
+
"nx": "24.1.0-beta.3",
|
|
189
|
+
"@nx/nest": "24.1.0-beta.3",
|
|
190
190
|
"@rspack/cli": "^2.0.4"
|
|
191
191
|
},
|
|
192
192
|
"peerDependencies": {
|