@rsbuild/core 2.0.14 → 2.0.15
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/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-chain/types/index.d.ts +30 -6
- package/dist/349.js +10 -0
- package/dist/756.js +27 -14
- package/dist/cssUrlLoader.mjs +3 -7
- package/dist/ignoreCssLoader.mjs +7 -1
- package/dist/memfs.js +104 -100
- package/dist/transformLoader.mjs +6 -9
- package/dist-types/helpers/css.d.ts +3 -0
- package/dist-types/loader/ignoreCssLoader.d.ts +9 -2
- package/package.json +5 -5
package/dist/transformLoader.mjs
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
let mergeSourceMap = async (originalSourceMap, generatedSourceMap)=>{
|
|
2
|
-
if (!originalSourceMap || !generatedSourceMap) return generatedSourceMap ?? originalSourceMap;
|
|
3
2
|
let { default: remapping } = await import("./remapping.js");
|
|
4
3
|
return remapping([
|
|
5
4
|
generatedSourceMap,
|
|
6
5
|
originalSourceMap
|
|
7
6
|
], ()=>null);
|
|
8
7
|
}, transformLoader = async function transform(source, map) {
|
|
9
|
-
let callback = this.async(),
|
|
10
|
-
|
|
11
|
-
}, { id: transformId, getEnvironment } = this.getOptions();
|
|
12
|
-
if (!transformId) return void bypass();
|
|
8
|
+
let callback = this.async(), { id: transformId, getEnvironment } = this.getOptions();
|
|
9
|
+
if (!transformId) return void callback(null, source, map);
|
|
13
10
|
let transform = this._compiler?.__rsbuildTransformer?.[transformId];
|
|
14
|
-
if (!transform) return void
|
|
11
|
+
if (!transform) return void callback(null, source, map);
|
|
15
12
|
try {
|
|
16
13
|
let result = await transform({
|
|
17
14
|
code: source,
|
|
@@ -27,12 +24,12 @@ let mergeSourceMap = async (originalSourceMap, generatedSourceMap)=>{
|
|
|
27
24
|
importModule: this.importModule.bind(this),
|
|
28
25
|
resolve: this.resolve.bind(this)
|
|
29
26
|
});
|
|
30
|
-
if (null == result) return void
|
|
27
|
+
if (null == result) return void callback(null, source, map);
|
|
31
28
|
if ('string' == typeof result || Buffer.isBuffer(result)) return void callback(null, result, map);
|
|
32
|
-
let mergedMap = await mergeSourceMap(map, result.map);
|
|
29
|
+
let mergedMap = map && result.map ? await mergeSourceMap(map, result.map) : result.map ?? map;
|
|
33
30
|
callback(null, result.code, mergedMap);
|
|
34
31
|
} catch (error) {
|
|
35
|
-
error instanceof Error ?
|
|
32
|
+
callback(error instanceof Error ? error : Error(String(error)));
|
|
36
33
|
}
|
|
37
34
|
};
|
|
38
35
|
export default transformLoader;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import type { LoaderDefinition } from '@rspack/core';
|
|
2
|
-
|
|
1
|
+
import type { LoaderDefinition, PitchLoaderDefinitionFunction } from '@rspack/core';
|
|
2
|
+
import type { CSSLoaderOptions } from '../types';
|
|
3
|
+
type IgnoreCssLoaderOptions = {
|
|
4
|
+
modules?: CSSLoaderOptions['modules'];
|
|
5
|
+
};
|
|
6
|
+
declare const ignoreCssLoader: LoaderDefinition<IgnoreCssLoaderOptions>;
|
|
7
|
+
// In non-emitting builds, skip css-loader and following CSS transforms for global CSS.
|
|
8
|
+
// CSS Modules must still pass through css-loader so SSR builds can export locals.
|
|
9
|
+
export declare const pitch: PitchLoaderDefinitionFunction<IgnoreCssLoaderOptions>;
|
|
3
10
|
export default ignoreCssLoader;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@jridgewell/remapping": "^2.3.5",
|
|
48
48
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
49
|
-
"@rslib/core": "0.22.
|
|
49
|
+
"@rslib/core": "0.22.1",
|
|
50
50
|
"@types/cors": "^2.8.19",
|
|
51
|
-
"@types/node": "^24.13.
|
|
51
|
+
"@types/node": "^24.13.2",
|
|
52
52
|
"@types/on-finished": "2.3.5",
|
|
53
53
|
"@types/range-parser": "^1.2.7",
|
|
54
54
|
"@types/ws": "^8.18.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"http-proxy-middleware": "4.1.0",
|
|
66
66
|
"jiti": "^2.7.0",
|
|
67
67
|
"launch-editor-middleware": "^2.14.1",
|
|
68
|
-
"memfs": "^4.57.
|
|
68
|
+
"memfs": "^4.57.7",
|
|
69
69
|
"mrmime": "^2.0.1",
|
|
70
70
|
"on-finished": "2.4.1",
|
|
71
71
|
"open": "^11.0.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"range-parser": "^1.2.1",
|
|
77
77
|
"reduce-configs": "^2.0.1",
|
|
78
78
|
"rslog": "^2.1.3",
|
|
79
|
-
"rspack-chain": "^2.0
|
|
79
|
+
"rspack-chain": "^2.1.0",
|
|
80
80
|
"rspack-manifest-plugin": "5.2.2",
|
|
81
81
|
"rspack-merge": "1.0.1",
|
|
82
82
|
"sirv": "^3.0.2",
|