@rspack/core 1.0.0-beta.0 → 1.0.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.
- package/dist/Compilation.d.ts +1 -1
- package/dist/Compiler.d.ts +11 -10
- package/dist/Compiler.js +14 -14
- package/dist/Module.d.ts +1 -0
- package/dist/Module.js +1 -0
- package/dist/NormalModule.d.ts +1 -0
- package/dist/NormalModule.js +1 -0
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +31 -31
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +3 -2
- package/dist/builtin-plugin/EntryPlugin.js +1 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +5 -5
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +9 -9
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +4 -11
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/loader.d.ts +8 -3
- package/dist/builtin-plugin/css-extract/loader.js +24 -13
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/adapter.js +15 -2
- package/dist/config/adapterRuleUse.js +3 -3
- package/dist/config/defaults.js +7 -10
- package/dist/config/normalization.d.ts +6 -3
- package/dist/config/normalization.js +2 -0
- package/dist/config/zod.d.ts +1224 -1055
- package/dist/config/zod.js +10 -1
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/lib/AbstractMethodError.d.ts +12 -3
- package/dist/lib/AbstractMethodError.js +29 -21
- package/dist/lib/Cache.d.ts +40 -46
- package/dist/lib/Cache.js +43 -78
- package/dist/lib/CacheFacade.d.ts +119 -143
- package/dist/lib/CacheFacade.js +123 -124
- package/dist/lib/EntryOptionPlugin.d.ts +19 -2
- package/dist/lib/EntryOptionPlugin.js +22 -6
- package/dist/lib/EnvironmentPlugin.d.ts +17 -10
- package/dist/lib/EnvironmentPlugin.js +16 -15
- package/dist/lib/HookWebpackError.d.ts +27 -33
- package/dist/lib/HookWebpackError.js +33 -34
- package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
- package/dist/lib/{ignoreWarningsPlugin.js → IgnoreWarningsPlugin.js} +17 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts +18 -9
- package/dist/lib/LoaderOptionsPlugin.js +38 -14
- package/dist/lib/LoaderTargetPlugin.d.ts +17 -8
- package/dist/lib/LoaderTargetPlugin.js +17 -15
- package/dist/lib/ModuleFilenameHelpers.d.ts +10 -1
- package/dist/lib/ModuleFilenameHelpers.js +9 -0
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +15 -5
- package/dist/lib/NormalModuleReplacementPlugin.js +15 -5
- package/dist/lib/WebpackError.d.ts +29 -22
- package/dist/lib/WebpackError.js +17 -29
- package/dist/lib/cache/getLazyHashedEtag.d.ts +24 -24
- package/dist/lib/cache/getLazyHashedEtag.js +20 -23
- package/dist/lib/cache/mergeEtags.d.ts +15 -9
- package/dist/lib/cache/mergeEtags.js +18 -11
- package/dist/lib/formatLocation.d.ts +13 -8
- package/dist/lib/formatLocation.js +17 -15
- package/dist/rspackOptionsApply.js +2 -2
- package/dist/stats/DefaultStatsFactoryPlugin.js +1 -1
- package/dist/util/comparators.d.ts +1 -1
- package/package.json +3 -3
- package/compiled/enhanced-resolve/index.js +0 -5566
- package/dist/lib/ignoreWarningsPlugin.d.ts +0 -7
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
-
Author Tobias Koppers @sokra
|
|
4
|
-
*/
|
|
5
1
|
"use strict";
|
|
6
|
-
const createHash = require("../../util/createHash");
|
|
7
|
-
// /** @typedef {import("../util/Hash")} Hash */
|
|
8
|
-
// /** @typedef {typeof import("../util/Hash")} HashConstructor */
|
|
9
|
-
/** @typedef {any} Hash */
|
|
10
|
-
/** @typedef {any} HashConstructor */
|
|
11
2
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
3
|
+
* The following code is modified based on
|
|
4
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/cache/getLazyHashedEtag.js
|
|
5
|
+
*
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
* Author Tobias Koppers @sokra
|
|
8
|
+
* Copyright (c) JS Foundation and other contributors
|
|
9
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
14
10
|
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getter = void 0;
|
|
13
|
+
const createHash_1 = require("../../util/createHash");
|
|
15
14
|
class LazyHashedEtag {
|
|
16
15
|
/**
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
16
|
+
* @param obj object with updateHash method
|
|
17
|
+
* @param hashFunction the hash function to use
|
|
19
18
|
*/
|
|
20
19
|
constructor(obj, hashFunction = "md4") {
|
|
21
20
|
this._obj = obj;
|
|
@@ -23,26 +22,23 @@ class LazyHashedEtag {
|
|
|
23
22
|
this._hashFunction = hashFunction;
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
|
-
* @returns
|
|
25
|
+
* @returns hash of object
|
|
27
26
|
*/
|
|
28
27
|
toString() {
|
|
29
28
|
if (this._hash === undefined) {
|
|
30
|
-
|
|
31
|
-
const hash = createHash(this._hashFunction);
|
|
29
|
+
const hash = (0, createHash_1.createHash)(this._hashFunction);
|
|
32
30
|
this._obj.updateHash(hash);
|
|
33
|
-
this._hash =
|
|
31
|
+
this._hash = hash.digest("base64");
|
|
34
32
|
}
|
|
35
33
|
return this._hash;
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
|
-
/** @type {Map<string | HashConstructor, WeakMap<HashableObject, LazyHashedEtag>>} */
|
|
39
36
|
const mapStrings = new Map();
|
|
40
|
-
/** @type {WeakMap<HashConstructor, WeakMap<HashableObject, LazyHashedEtag>>} */
|
|
41
37
|
const mapObjects = new WeakMap();
|
|
42
38
|
/**
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
45
|
-
* @returns
|
|
39
|
+
* @param obj object with updateHash method
|
|
40
|
+
* @param ashFunction the hash function to use
|
|
41
|
+
* @returns etag
|
|
46
42
|
*/
|
|
47
43
|
const getter = (obj, hashFunction = "md4") => {
|
|
48
44
|
let innerMap;
|
|
@@ -73,4 +69,5 @@ const getter = (obj, hashFunction = "md4") => {
|
|
|
73
69
|
innerMap.set(obj, newHash);
|
|
74
70
|
return newHash;
|
|
75
71
|
};
|
|
76
|
-
|
|
72
|
+
exports.getter = getter;
|
|
73
|
+
exports.default = exports.getter;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
export = mergeEtags;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/cache/mergeEtags.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
6
9
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import type { Etag } from "../Cache";
|
|
11
|
+
/**
|
|
12
|
+
* @param a first
|
|
13
|
+
* @param b second
|
|
14
|
+
* @returns result
|
|
15
|
+
*/
|
|
16
|
+
export declare const mergeEtags: (a: Etag, b: Etag) => Etag;
|
|
17
|
+
export default mergeEtags;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
/*
|
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
-
Author Tobias Koppers @sokra
|
|
4
|
-
*/
|
|
5
1
|
"use strict";
|
|
6
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The following code is modified based on
|
|
4
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/cache/mergeEtags.js
|
|
5
|
+
*
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
* Author Tobias Koppers @sokra
|
|
8
|
+
* Copyright (c) JS Foundation and other contributors
|
|
9
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.mergeEtags = void 0;
|
|
7
13
|
class MergedEtag {
|
|
8
14
|
/**
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
15
|
+
* @param a first
|
|
16
|
+
* @param b second
|
|
11
17
|
*/
|
|
12
18
|
constructor(a, b) {
|
|
13
19
|
this.a = a;
|
|
@@ -20,9 +26,9 @@ class MergedEtag {
|
|
|
20
26
|
const dualObjectMap = new WeakMap();
|
|
21
27
|
const objectStringMap = new WeakMap();
|
|
22
28
|
/**
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @returns
|
|
29
|
+
* @param a first
|
|
30
|
+
* @param b second
|
|
31
|
+
* @returns result
|
|
26
32
|
*/
|
|
27
33
|
const mergeEtags = (a, b) => {
|
|
28
34
|
if (typeof a === "string") {
|
|
@@ -62,4 +68,5 @@ const mergeEtags = (a, b) => {
|
|
|
62
68
|
}
|
|
63
69
|
return mergedEtag;
|
|
64
70
|
};
|
|
65
|
-
|
|
71
|
+
exports.mergeEtags = mergeEtags;
|
|
72
|
+
exports.default = exports.mergeEtags;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
export = formatLocation;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/formatLocation.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
5
9
|
*/
|
|
6
|
-
declare function formatLocation(loc: DependencyLocation): string;
|
|
7
|
-
declare namespace formatLocation {
|
|
8
|
-
export { DependencyLocation, SourcePosition };
|
|
9
|
-
}
|
|
10
10
|
type DependencyLocation = any;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @param loc location
|
|
13
|
+
* @returns formatted location
|
|
14
|
+
*/
|
|
15
|
+
declare const formatLocation: (loc: DependencyLocation) => string;
|
|
16
|
+
export default formatLocation;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
/*
|
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
-
Author Tobias Koppers @sokra
|
|
4
|
-
*/
|
|
5
1
|
"use strict";
|
|
6
|
-
// /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
|
|
7
|
-
// /** @typedef {import("./Dependency").SourcePosition} SourcePosition */
|
|
8
|
-
/** @typedef {any} DependencyLocation */
|
|
9
|
-
/** @typedef {any} SourcePosition */
|
|
10
2
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
3
|
+
* The following code is modified based on
|
|
4
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/formatLocation.js
|
|
5
|
+
*
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
* Author Tobias Koppers @sokra
|
|
8
|
+
* Copyright (c) JS Foundation and other contributors
|
|
9
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
13
10
|
*/
|
|
14
|
-
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/**
|
|
13
|
+
* @param pos position
|
|
14
|
+
* @returns formatted position
|
|
15
|
+
*/
|
|
16
|
+
const formatPosition = (pos) => {
|
|
15
17
|
if (pos && typeof pos === "object") {
|
|
16
18
|
if ("line" in pos && "column" in pos) {
|
|
17
19
|
return `${pos.line}:${pos.column}`;
|
|
@@ -23,10 +25,10 @@ const formatPosition = pos => {
|
|
|
23
25
|
return "";
|
|
24
26
|
};
|
|
25
27
|
/**
|
|
26
|
-
* @param
|
|
27
|
-
* @returns
|
|
28
|
+
* @param loc location
|
|
29
|
+
* @returns formatted location
|
|
28
30
|
*/
|
|
29
|
-
const formatLocation = loc => {
|
|
31
|
+
const formatLocation = (loc) => {
|
|
30
32
|
if (loc && typeof loc === "object") {
|
|
31
33
|
if ("start" in loc && loc.start && "end" in loc && loc.end) {
|
|
32
34
|
if (typeof loc.start === "object" &&
|
|
@@ -59,4 +61,4 @@ const formatLocation = loc => {
|
|
|
59
61
|
}
|
|
60
62
|
return "";
|
|
61
63
|
};
|
|
62
|
-
|
|
64
|
+
exports.default = formatLocation;
|
|
@@ -18,7 +18,7 @@ const graceful_fs_1 = __importDefault(require("../compiled/graceful-fs"));
|
|
|
18
18
|
const Module_1 = require("./Module");
|
|
19
19
|
const builtin_plugin_1 = require("./builtin-plugin");
|
|
20
20
|
const EntryOptionPlugin_1 = __importDefault(require("./lib/EntryOptionPlugin"));
|
|
21
|
-
const
|
|
21
|
+
const IgnoreWarningsPlugin_1 = __importDefault(require("./lib/IgnoreWarningsPlugin"));
|
|
22
22
|
const DefaultStatsFactoryPlugin_1 = require("./stats/DefaultStatsFactoryPlugin");
|
|
23
23
|
const DefaultStatsPresetPlugin_1 = require("./stats/DefaultStatsPresetPlugin");
|
|
24
24
|
const DefaultStatsPrinterPlugin_1 = require("./stats/DefaultStatsPrinterPlugin");
|
|
@@ -258,7 +258,7 @@ class RspackOptionsApply {
|
|
|
258
258
|
new DefaultStatsPresetPlugin_1.DefaultStatsPresetPlugin().apply(compiler);
|
|
259
259
|
new DefaultStatsPrinterPlugin_1.DefaultStatsPrinterPlugin().apply(compiler);
|
|
260
260
|
if (options.ignoreWarnings && options.ignoreWarnings.length > 0) {
|
|
261
|
-
new
|
|
261
|
+
new IgnoreWarningsPlugin_1.default(options.ignoreWarnings).apply(compiler);
|
|
262
262
|
}
|
|
263
263
|
compiler.hooks.afterPlugins.call(compiler);
|
|
264
264
|
if (!compiler.inputFileSystem) {
|
|
@@ -810,7 +810,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
810
810
|
const { type } = context;
|
|
811
811
|
object.type = module.type;
|
|
812
812
|
object.moduleType = module.moduleType;
|
|
813
|
-
|
|
813
|
+
object.layer = module.layer;
|
|
814
814
|
object.size = module.size;
|
|
815
815
|
const sizes = module.sizes.map(({ sourceType, size }) => [
|
|
816
816
|
sourceType,
|
|
@@ -16,5 +16,5 @@ export declare const compareIds: (a: string | number, b: string | number) => -1
|
|
|
16
16
|
export declare const compareChunksById: (a: Chunk, b: Chunk) => -1 | 0 | 1;
|
|
17
17
|
export declare const compareChunkGroupsByIndex: (a: ChunkGroup, b: ChunkGroup) => -1 | 0 | 1;
|
|
18
18
|
export declare const compareSelect: <T, R>(getter: Selector<T, R>, comparator: Comparator) => Comparator;
|
|
19
|
-
export declare const compareNumbers: (a: number, b: number) =>
|
|
19
|
+
export declare const compareNumbers: (a: number, b: number) => 1 | 0 | -1;
|
|
20
20
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@module-federation/runtime-tools": "0.2.3",
|
|
61
61
|
"caniuse-lite": "^1.0.30001616",
|
|
62
|
-
"@rspack/
|
|
63
|
-
"@rspack/
|
|
62
|
+
"@rspack/lite-tapable": "1.0.0-beta.1",
|
|
63
|
+
"@rspack/binding": "1.0.0-beta.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@swc/helpers": ">=0.5.1"
|