@rspack/core 1.2.5 → 1.2.7-alpha.0
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/browserslist/index.js +136 -86
- package/compiled/browserslist/package.json +1 -1
- package/compiled/watchpack/index.js +27 -17
- package/compiled/watchpack/package.json +1 -1
- package/compiled/zod/index.d.ts +1 -1
- package/compiled/zod/index.js +63 -40
- package/compiled/zod/package.json +1 -1
- package/dist/Compilation.d.ts +2 -3
- package/dist/Compiler.d.ts +5 -0
- package/dist/Module.d.ts +2 -3
- package/dist/config/adapterRuleUse.d.ts +157 -4
- package/dist/config/types.d.ts +3 -3
- package/dist/config/zod.d.ts +113 -113
- package/dist/index.js +24 -86
- package/package.json +13 -13
- package/dist/util/AssetInfo.d.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -38,9 +38,9 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
38
38
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
39
39
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
40
40
|
|
|
41
|
-
// ../../node_modules/.pnpm/json-parse-even-better-errors@3.0.
|
|
41
|
+
// ../../node_modules/.pnpm/json-parse-even-better-errors@3.0.2/node_modules/json-parse-even-better-errors/lib/index.js
|
|
42
42
|
var require_lib = __commonJS({
|
|
43
|
-
"../../node_modules/.pnpm/json-parse-even-better-errors@3.0.
|
|
43
|
+
"../../node_modules/.pnpm/json-parse-even-better-errors@3.0.2/node_modules/json-parse-even-better-errors/lib/index.js"(exports2, module2) {
|
|
44
44
|
"use strict";
|
|
45
45
|
var INDENT = Symbol.for("indent");
|
|
46
46
|
var NEWLINE = Symbol.for("newline");
|
|
@@ -687,8 +687,8 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
687
687
|
});
|
|
688
688
|
|
|
689
689
|
// src/index.ts
|
|
690
|
-
var
|
|
691
|
-
__export(
|
|
690
|
+
var index_exports = {};
|
|
691
|
+
__export(index_exports, {
|
|
692
692
|
BannerPlugin: () => BannerPlugin,
|
|
693
693
|
Compilation: () => Compilation,
|
|
694
694
|
Compiler: () => Compiler,
|
|
@@ -733,7 +733,7 @@ __export(src_exports, {
|
|
|
733
733
|
WebpackOptionsApply: () => RspackOptionsApply,
|
|
734
734
|
config: () => config,
|
|
735
735
|
container: () => container,
|
|
736
|
-
default: () =>
|
|
736
|
+
default: () => index_default,
|
|
737
737
|
electron: () => electron,
|
|
738
738
|
experiments: () => experiments2,
|
|
739
739
|
javascript: () => javascript,
|
|
@@ -750,7 +750,7 @@ __export(src_exports, {
|
|
|
750
750
|
web: () => web,
|
|
751
751
|
webworker: () => webworker
|
|
752
752
|
});
|
|
753
|
-
module.exports = __toCommonJS(
|
|
753
|
+
module.exports = __toCommonJS(index_exports);
|
|
754
754
|
|
|
755
755
|
// src/exports.ts
|
|
756
756
|
var exports_exports = {};
|
|
@@ -894,72 +894,6 @@ var DependenciesBlock = class _DependenciesBlock {
|
|
|
894
894
|
}
|
|
895
895
|
};
|
|
896
896
|
|
|
897
|
-
// src/util/AssetInfo.ts
|
|
898
|
-
var JsAssetInfo = class {
|
|
899
|
-
static __from_binding(jsAssetInfo) {
|
|
900
|
-
const {
|
|
901
|
-
immutable,
|
|
902
|
-
minimized,
|
|
903
|
-
development,
|
|
904
|
-
hotModuleReplacement,
|
|
905
|
-
related,
|
|
906
|
-
chunkhash,
|
|
907
|
-
fullhash,
|
|
908
|
-
contenthash,
|
|
909
|
-
javascriptModule,
|
|
910
|
-
sourceFilename,
|
|
911
|
-
copied,
|
|
912
|
-
extras
|
|
913
|
-
} = jsAssetInfo;
|
|
914
|
-
return {
|
|
915
|
-
...extras,
|
|
916
|
-
// extras should not overwrite any KnownAssetFields
|
|
917
|
-
immutable,
|
|
918
|
-
minimized,
|
|
919
|
-
development,
|
|
920
|
-
hotModuleReplacement,
|
|
921
|
-
related,
|
|
922
|
-
fullhash,
|
|
923
|
-
chunkhash,
|
|
924
|
-
contenthash,
|
|
925
|
-
javascriptModule,
|
|
926
|
-
sourceFilename,
|
|
927
|
-
copied
|
|
928
|
-
};
|
|
929
|
-
}
|
|
930
|
-
static __to_binding(assetInfo = {}) {
|
|
931
|
-
let {
|
|
932
|
-
immutable = false,
|
|
933
|
-
minimized = false,
|
|
934
|
-
development = false,
|
|
935
|
-
hotModuleReplacement = false,
|
|
936
|
-
related = {},
|
|
937
|
-
fullhash = [],
|
|
938
|
-
chunkhash = [],
|
|
939
|
-
contenthash = [],
|
|
940
|
-
javascriptModule,
|
|
941
|
-
sourceFilename,
|
|
942
|
-
copied,
|
|
943
|
-
...extras
|
|
944
|
-
} = assetInfo;
|
|
945
|
-
extras = extras ?? {};
|
|
946
|
-
return {
|
|
947
|
-
immutable,
|
|
948
|
-
minimized,
|
|
949
|
-
development,
|
|
950
|
-
hotModuleReplacement,
|
|
951
|
-
related,
|
|
952
|
-
fullhash,
|
|
953
|
-
chunkhash,
|
|
954
|
-
contenthash,
|
|
955
|
-
extras,
|
|
956
|
-
javascriptModule,
|
|
957
|
-
sourceFilename,
|
|
958
|
-
copied
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
|
|
963
897
|
// src/util/source.ts
|
|
964
898
|
var import_webpack_sources = require("../compiled/webpack-sources/index.js");
|
|
965
899
|
var JsSource = class extends import_webpack_sources.Source {
|
|
@@ -1260,7 +1194,7 @@ var Module = class _Module {
|
|
|
1260
1194
|
return this.#inner.emitFile(
|
|
1261
1195
|
filename2,
|
|
1262
1196
|
JsSource.__to_binding(source),
|
|
1263
|
-
|
|
1197
|
+
assetInfo
|
|
1264
1198
|
);
|
|
1265
1199
|
}
|
|
1266
1200
|
};
|
|
@@ -3231,7 +3165,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3231
3165
|
__privateGet(this, _inner).updateAsset(
|
|
3232
3166
|
filename2,
|
|
3233
3167
|
compatNewSourceOrFunction,
|
|
3234
|
-
assetInfoUpdateOrFunction === void 0 ? assetInfoUpdateOrFunction : typeof assetInfoUpdateOrFunction === "function" ? (
|
|
3168
|
+
assetInfoUpdateOrFunction === void 0 ? assetInfoUpdateOrFunction : typeof assetInfoUpdateOrFunction === "function" ? (assetInfo) => assetInfoUpdateOrFunction(assetInfo) : assetInfoUpdateOrFunction
|
|
3235
3169
|
);
|
|
3236
3170
|
}
|
|
3237
3171
|
/**
|
|
@@ -3242,11 +3176,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3242
3176
|
* @param assetInfo - extra asset information
|
|
3243
3177
|
*/
|
|
3244
3178
|
emitAsset(filename2, source, assetInfo) {
|
|
3245
|
-
__privateGet(this, _inner).emitAsset(
|
|
3246
|
-
filename2,
|
|
3247
|
-
JsSource.__to_binding(source),
|
|
3248
|
-
JsAssetInfo.__to_binding(assetInfo)
|
|
3249
|
-
);
|
|
3179
|
+
__privateGet(this, _inner).emitAsset(filename2, JsSource.__to_binding(source), assetInfo);
|
|
3250
3180
|
}
|
|
3251
3181
|
deleteAsset(filename2) {
|
|
3252
3182
|
__privateGet(this, _inner).deleteAsset(filename2);
|
|
@@ -3262,7 +3192,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3262
3192
|
return assets.map((asset) => {
|
|
3263
3193
|
return Object.defineProperties(asset, {
|
|
3264
3194
|
info: {
|
|
3265
|
-
value:
|
|
3195
|
+
value: asset.info
|
|
3266
3196
|
},
|
|
3267
3197
|
source: {
|
|
3268
3198
|
get: () => this.__internal__getAssetSource(asset.name)
|
|
@@ -3277,7 +3207,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3277
3207
|
}
|
|
3278
3208
|
return Object.defineProperties(asset, {
|
|
3279
3209
|
info: {
|
|
3280
|
-
value:
|
|
3210
|
+
value: asset.info
|
|
3281
3211
|
},
|
|
3282
3212
|
source: {
|
|
3283
3213
|
get: () => this.__internal__getAssetSource(asset.name)
|
|
@@ -6128,11 +6058,14 @@ async function runLoaders(compiler, context2) {
|
|
|
6128
6058
|
}
|
|
6129
6059
|
};
|
|
6130
6060
|
};
|
|
6131
|
-
const
|
|
6061
|
+
const getResolver = memoize(() => {
|
|
6062
|
+
return compiler._lastCompilation.resolverFactory.get("normal");
|
|
6063
|
+
});
|
|
6132
6064
|
loaderContext.resolve = function resolve2(context3, request, callback) {
|
|
6133
|
-
|
|
6065
|
+
getResolver().resolve({}, context3, request, getResolveContext(), callback);
|
|
6134
6066
|
};
|
|
6135
6067
|
loaderContext.getResolve = function getResolve(options) {
|
|
6068
|
+
const resolver = getResolver();
|
|
6136
6069
|
const child = options ? resolver.withOptions(options) : resolver;
|
|
6137
6070
|
return (context3, request, callback) => {
|
|
6138
6071
|
if (callback) {
|
|
@@ -8096,7 +8029,7 @@ var cleanPluginHooks = (compilation) => {
|
|
|
8096
8029
|
// src/builtin-plugin/html-plugin/options.ts
|
|
8097
8030
|
var import_zod = require("../compiled/zod/index.js");
|
|
8098
8031
|
|
|
8099
|
-
// ../../node_modules/.pnpm/zod-validation-error@3.4.0_zod@3.24.
|
|
8032
|
+
// ../../node_modules/.pnpm/zod-validation-error@3.4.0_zod@3.24.2/node_modules/zod-validation-error/dist/index.mjs
|
|
8100
8033
|
var zod2 = __toESM(require("../compiled/zod/index.js"), 1);
|
|
8101
8034
|
var zod = __toESM(require("../compiled/zod/index.js"), 1);
|
|
8102
8035
|
function isZodErrorLike(err) {
|
|
@@ -11402,7 +11335,7 @@ ${helpMessage}`
|
|
|
11402
11335
|
D(output2, "workerPublicPath", "");
|
|
11403
11336
|
D(output2, "sourceMapFilename", "[file].map[query]");
|
|
11404
11337
|
F(output2, "scriptType", () => output2.module ? "module" : false);
|
|
11405
|
-
D(output2, "charset",
|
|
11338
|
+
D(output2, "charset", !futureDefaults);
|
|
11406
11339
|
D(output2, "chunkLoadTimeout", 12e4);
|
|
11407
11340
|
const { trustedTypes: trustedTypes2 } = output2;
|
|
11408
11341
|
if (trustedTypes2) {
|
|
@@ -15238,6 +15171,11 @@ var Compiler = class _Compiler {
|
|
|
15238
15171
|
const isRoot = this.root === this;
|
|
15239
15172
|
return !isRoot;
|
|
15240
15173
|
}
|
|
15174
|
+
/**
|
|
15175
|
+
* Create a compilation and run it, which is the basic method that `compiler.run` and `compiler.watch` depend on.
|
|
15176
|
+
* TODO: make this method private in the next major release
|
|
15177
|
+
* @private this method is only used in Rspack core
|
|
15178
|
+
*/
|
|
15241
15179
|
compile(callback) {
|
|
15242
15180
|
const startTime = Date.now();
|
|
15243
15181
|
const params = this.#newCompilationParams();
|
|
@@ -21060,7 +20998,7 @@ var fn = Object.assign(rspack2, exports_exports);
|
|
|
21060
20998
|
fn.rspack = fn;
|
|
21061
20999
|
fn.webpack = fn;
|
|
21062
21000
|
var rspack = fn;
|
|
21063
|
-
var
|
|
21001
|
+
var index_default = rspack;
|
|
21064
21002
|
module.exports = rspack;
|
|
21065
21003
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21066
21004
|
0 && (module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7-alpha.0",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -37,33 +37,33 @@
|
|
|
37
37
|
"directory": "packages/rspack"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@swc/core": "1.10.
|
|
40
|
+
"@swc/core": "1.10.18",
|
|
41
41
|
"@swc/types": "0.1.17",
|
|
42
42
|
"@types/graceful-fs": "4.1.9",
|
|
43
|
-
"@types/watchpack": "^2.4.
|
|
43
|
+
"@types/watchpack": "^2.4.4",
|
|
44
44
|
"@types/webpack-sources": "3.2.3",
|
|
45
|
-
"browserslist": "^4.
|
|
45
|
+
"browserslist": "^4.24.4",
|
|
46
46
|
"cross-env": "^7.0.3",
|
|
47
47
|
"enhanced-resolve": "5.18.1",
|
|
48
48
|
"graceful-fs": "^4.2.11",
|
|
49
|
-
"json-parse-even-better-errors": "^3.0.
|
|
49
|
+
"json-parse-even-better-errors": "^3.0.2",
|
|
50
50
|
"prebundle": "^1.2.7",
|
|
51
|
-
"tsc-alias": "^1.8.
|
|
52
|
-
"tsup": "^8.3.
|
|
53
|
-
"tsx": "^4.19.
|
|
51
|
+
"tsc-alias": "^1.8.11",
|
|
52
|
+
"tsup": "^8.3.6",
|
|
53
|
+
"tsx": "^4.19.3",
|
|
54
54
|
"typescript": "^5.7.3",
|
|
55
|
-
"watchpack": "^2.4.
|
|
55
|
+
"watchpack": "^2.4.2",
|
|
56
56
|
"webpack-dev-server": "5.0.4",
|
|
57
57
|
"webpack-sources": "3.2.3",
|
|
58
|
-
"zod": "^3.24.
|
|
58
|
+
"zod": "^3.24.2",
|
|
59
59
|
"zod-validation-error": "3.4.0",
|
|
60
|
-
"@rspack/tracing": "1.2.
|
|
60
|
+
"@rspack/tracing": "1.2.7-alpha.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@module-federation/runtime-tools": "0.8.4",
|
|
64
64
|
"@rspack/lite-tapable": "1.0.1",
|
|
65
|
-
"caniuse-lite": "^1.0.
|
|
66
|
-
"@rspack/binding": "1.2.
|
|
65
|
+
"caniuse-lite": "^1.0.30001700",
|
|
66
|
+
"@rspack/binding": "1.2.7-alpha.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@rspack/tracing": "^1.x",
|
package/dist/util/AssetInfo.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { JsAssetInfo as JsAssetInfoBinding } from "@rspack/binding";
|
|
2
|
-
export type AssetInfo = Partial<Omit<JsAssetInfoBinding, "extras">> & Record<string, any>;
|
|
3
|
-
declare class JsAssetInfo {
|
|
4
|
-
static __from_binding(jsAssetInfo: JsAssetInfoBinding): AssetInfo;
|
|
5
|
-
static __to_binding(assetInfo?: AssetInfo): JsAssetInfoBinding;
|
|
6
|
-
}
|
|
7
|
-
export { JsAssetInfo };
|