@nx/rspack 23.1.0 → 23.2.0-beta.1
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.
|
@@ -16,12 +16,24 @@ function resolveConditionalExport(target) {
|
|
|
16
16
|
if (typeof target === 'string') {
|
|
17
17
|
return target;
|
|
18
18
|
}
|
|
19
|
+
// Fallback arrays: take the first non-empty target. Node resolves them in
|
|
20
|
+
// order on disk; for the allowlist any valid target marks the subpath.
|
|
21
|
+
if (Array.isArray(target)) {
|
|
22
|
+
for (const candidate of target) {
|
|
23
|
+
const resolved = resolveConditionalExport(candidate);
|
|
24
|
+
if (resolved) {
|
|
25
|
+
return resolved;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
19
30
|
if (typeof target === 'object' && target !== null) {
|
|
20
31
|
// Priority order for conditions
|
|
21
32
|
const conditions = ['development', 'import', 'require', 'default'];
|
|
22
33
|
for (const condition of conditions) {
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
const resolved = resolveConditionalExport(target[condition]);
|
|
35
|
+
if (resolved) {
|
|
36
|
+
return resolved;
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
39
|
}
|
|
@@ -4,7 +4,6 @@ exports.PostcssCliResources = PostcssCliResources;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const loader_utils_1 = require("loader-utils");
|
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
|
7
|
-
const url_1 = require("url");
|
|
8
7
|
function wrapUrl(url) {
|
|
9
8
|
let wrappedUrl;
|
|
10
9
|
const hasSingleQuotes = url.indexOf("'") >= 0;
|
|
@@ -80,14 +79,19 @@ function PostcssCliResources(options) {
|
|
|
80
79
|
// Separate URL query/hash from the file path before resolving
|
|
81
80
|
const [, filePath, urlSuffix] = inputUrl.match(/^([^?#]*)(.*)$/);
|
|
82
81
|
const resolvedPath = path.resolve(context, filePath.replace(/\\/g, '/'));
|
|
83
|
-
|
|
82
|
+
// Resolve a relative filesystem path, not a file:// URL pathname: on Windows the
|
|
83
|
+
// pathname is `/C:/...` (spaces as %20), which the resolver cannot find. Relative
|
|
84
|
+
// (not absolute) lets `resolve()`'s `./`-prefixed lookup succeed on the first try.
|
|
85
|
+
const resolveRequest = path
|
|
86
|
+
.relative(context, resolvedPath)
|
|
87
|
+
.replace(/\\/g, '/');
|
|
84
88
|
let hash = '';
|
|
85
89
|
let search = '';
|
|
86
90
|
if (urlSuffix) {
|
|
87
91
|
({ hash, search } = new URL(`file:///dummy${urlSuffix}`));
|
|
88
92
|
}
|
|
89
93
|
const resolver = (file, base) => new Promise((resolve, reject) => {
|
|
90
|
-
loader.resolve(base,
|
|
94
|
+
loader.resolve(base, file, (err, result) => {
|
|
91
95
|
if (err) {
|
|
92
96
|
reject(err);
|
|
93
97
|
return;
|
|
@@ -95,7 +99,7 @@ function PostcssCliResources(options) {
|
|
|
95
99
|
resolve(result);
|
|
96
100
|
});
|
|
97
101
|
});
|
|
98
|
-
const result = await resolve(
|
|
102
|
+
const result = await resolve(resolveRequest, context, resolver);
|
|
99
103
|
return new Promise((resolve, reject) => {
|
|
100
104
|
loader.fs.readFile(result, (err, content) => {
|
|
101
105
|
if (err) {
|
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": "23.
|
|
4
|
+
"version": "23.2.0-beta.1",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -152,14 +152,14 @@
|
|
|
152
152
|
"tslib": "^2.3.0",
|
|
153
153
|
"webpack": "5.105.2",
|
|
154
154
|
"webpack-node-externals": "^3.0.0",
|
|
155
|
-
"@nx/devkit": "23.
|
|
156
|
-
"@nx/js": "23.
|
|
157
|
-
"@nx/module-federation": "23.
|
|
158
|
-
"@nx/web": "23.
|
|
155
|
+
"@nx/devkit": "23.2.0-beta.1",
|
|
156
|
+
"@nx/js": "23.2.0-beta.1",
|
|
157
|
+
"@nx/module-federation": "23.2.0-beta.1",
|
|
158
|
+
"@nx/web": "23.2.0-beta.1"
|
|
159
159
|
},
|
|
160
160
|
"devDependencies": {
|
|
161
|
-
"nx": "23.
|
|
162
|
-
"@nx/nest": "23.
|
|
161
|
+
"nx": "23.2.0-beta.1",
|
|
162
|
+
"@nx/nest": "23.2.0-beta.1"
|
|
163
163
|
},
|
|
164
164
|
"peerDependencies": {
|
|
165
165
|
"@rspack/cli": "^1.0.0 || ^2.0.0",
|