@nx/rsbuild 22.7.2 → 22.7.4
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 +4 -4
- package/src/plugins/plugin.js +8 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rsbuild",
|
|
3
3
|
"description": "The Nx Plugin for Rsbuild contains an Nx plugin, executors and utilities that support building applications using Rsbuild.",
|
|
4
|
-
"version": "22.7.
|
|
4
|
+
"version": "22.7.4",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"executors": "./executors.json",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"tslib": "^2.3.0",
|
|
33
|
-
"@nx/devkit": "22.7.
|
|
34
|
-
"@nx/js": "22.7.
|
|
33
|
+
"@nx/devkit": "22.7.4",
|
|
34
|
+
"@nx/js": "22.7.4",
|
|
35
35
|
"@rsbuild/core": "1.1.8",
|
|
36
36
|
"minimatch": "10.2.5",
|
|
37
37
|
"@phenomnomnominal/tsquery": "~6.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"nx": "22.7.
|
|
40
|
+
"nx": "22.7.4"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {},
|
|
43
43
|
"nx-migrations": {
|
package/src/plugins/plugin.js
CHANGED
|
@@ -11,7 +11,6 @@ const js_1 = require("@nx/js");
|
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
const minimatch_1 = require("minimatch");
|
|
14
|
-
const core_1 = require("@rsbuild/core");
|
|
15
14
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
16
15
|
function readTargetsCache(cachePath) {
|
|
17
16
|
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
@@ -61,7 +60,10 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
61
60
|
}
|
|
62
61
|
async function createRsbuildTargets(configFilePath, projectRoot, options, tsConfigFiles, isUsingTsSolutionSetup, context, pmc) {
|
|
63
62
|
const absoluteConfigFilePath = (0, devkit_1.joinPathFragments)(context.workspaceRoot, configFilePath);
|
|
64
|
-
|
|
63
|
+
// Lazy require so the spec's `jest.resetModules()` between tests can
|
|
64
|
+
// re-mock loadConfig — a top-level import would bind to a stale module.
|
|
65
|
+
const { loadConfig } = require('@rsbuild/core');
|
|
66
|
+
const rsbuildConfig = await loadConfig({
|
|
65
67
|
path: absoluteConfigFilePath,
|
|
66
68
|
});
|
|
67
69
|
if (!rsbuildConfig.filePath) {
|
|
@@ -160,9 +162,10 @@ async function createRsbuildTargets(configFilePath, projectRoot, options, tsConf
|
|
|
160
162
|
return { targets, metadata: {} };
|
|
161
163
|
}
|
|
162
164
|
function getOutputs(rsbuildConfig, projectRoot, workspaceRoot) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
// `output.distPath.root` is the directory Rsbuild emits the build into, so
|
|
166
|
+
// it is the build output as-is. (Don't take its `dirname` - that points at
|
|
167
|
+
// the parent directory, which can capture sibling projects' outputs.)
|
|
168
|
+
const buildOutputPath = normalizeOutputPath(rsbuildConfig?.output?.distPath?.root, projectRoot, workspaceRoot, 'dist');
|
|
166
169
|
return {
|
|
167
170
|
buildOutputs: [buildOutputPath],
|
|
168
171
|
};
|