@rspack/core 1.0.0-alpha.5 → 1.0.0-beta.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/zod/index.d.ts +138 -52
- package/compiled/zod/index.js +300 -103
- package/compiled/zod/package.json +1 -1
- package/compiled/zod-validation-error/index.js +6 -6
- package/dist/Compilation.d.ts +21 -3
- package/dist/Compilation.js +64 -49
- package/dist/Compiler.js +28 -28
- package/dist/ErrorHelpers.js +2 -4
- package/dist/Module.js +2 -6
- package/dist/ModuleTypeConstants.d.ts +45 -69
- package/dist/ModuleTypeConstants.js +24 -77
- package/dist/Stats.js +4 -6
- package/dist/Template.d.ts +31 -147
- package/dist/Template.js +40 -236
- package/dist/builtin-loader/lightningcss/index.d.ts +89 -0
- package/dist/builtin-loader/lightningcss/index.js +175 -0
- package/dist/builtin-plugin/BannerPlugin.d.ts +24 -48
- package/dist/builtin-plugin/DefinePlugin.js +9 -13
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +24 -0
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +8 -8
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +10 -3
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +4 -1
- package/dist/builtin-plugin/SplitChunksPlugin.js +5 -15
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +15 -23
- package/dist/builtin-plugin/base.js +1 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +17 -66
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +2 -0
- package/dist/builtin-plugin/css-extract/hmr/{normalize-url.js → normalizeUrl.js} +15 -24
- package/dist/builtin-plugin/css-extract/loader.js +5 -5
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapter.js +24 -23
- package/dist/config/adapterRuleUse.d.ts +5 -5
- package/dist/config/adapterRuleUse.js +23 -1
- package/dist/config/browserslistTargetHandler.d.ts +17 -15
- package/dist/config/browserslistTargetHandler.js +27 -33
- package/dist/config/defaults.js +20 -21
- package/dist/config/normalization.d.ts +2 -0
- package/dist/config/normalization.js +5 -5
- package/dist/config/target.d.ts +48 -109
- package/dist/config/target.js +50 -86
- package/dist/config/zod.d.ts +2391 -2205
- package/dist/config/zod.js +28 -18
- package/dist/container/ContainerPlugin.d.ts +7 -7
- package/dist/container/options.js +1 -1
- package/dist/exports.d.ts +4 -4
- package/dist/exports.js +2 -2
- package/dist/lib/CacheFacade.js +1 -0
- package/dist/lib/ModuleFilenameHelpers.js +1 -3
- package/dist/lib/cache/mergeEtags.js +5 -11
- package/dist/lib/formatLocation.js +3 -5
- package/dist/loader-runner/LoaderLoadingError.d.ts +11 -1
- package/dist/loader-runner/LoaderLoadingError.js +3 -5
- package/dist/loader-runner/index.js +7 -9
- package/dist/loader-runner/loadLoader.d.ts +11 -2
- package/dist/loader-runner/loadLoader.js +17 -19
- package/dist/logging/createConsoleLogger.js +2 -6
- package/dist/logging/truncateArgs.js +5 -9
- package/dist/node/nodeConsole.js +1 -3
- package/dist/stats/DefaultStatsFactoryPlugin.js +17 -7
- package/dist/stats/DefaultStatsPresetPlugin.js +4 -4
- package/dist/stats/DefaultStatsPrinterPlugin.js +11 -16
- package/dist/stats/StatsFactory.js +13 -17
- package/dist/stats/StatsPrinter.js +7 -9
- package/dist/util/AssetInfo.js +11 -7
- package/dist/util/SplitChunkSize.js +1 -1
- package/dist/util/cleverMerge.d.ts +33 -57
- package/dist/util/cleverMerge.js +89 -145
- package/dist/util/comparators.js +3 -5
- package/dist/util/createHash.d.ts +4 -3
- package/dist/util/createHash.js +31 -45
- package/dist/util/fs.js +9 -13
- package/dist/util/hash/BatchedHash.d.ts +24 -9
- package/dist/util/hash/BatchedHash.js +16 -13
- package/dist/util/hash/index.d.ts +9 -9
- package/dist/util/hash/index.js +14 -11
- package/dist/util/hash/md4.d.ts +29 -2
- package/dist/util/hash/md4.js +7 -3
- package/dist/util/hash/wasm-hash.d.ts +52 -5
- package/dist/util/hash/wasm-hash.js +19 -22
- package/dist/util/hash/xxhash64.d.ts +29 -2
- package/dist/util/hash/xxhash64.js +7 -3
- package/dist/util/identifier.js +9 -15
- package/dist/util/index.js +1 -1
- package/dist/util/memoize.js +7 -9
- package/package.json +9 -8
- package/dist/builtin-plugin/css-extract/hmr/normalize-url.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod","author":"Colin McDonnell <colin@colinhacks.com>","version":"3.
|
|
1
|
+
{"name":"zod","author":"Colin McDonnell <colin@colinhacks.com>","version":"3.23.8","funding":"https://github.com/sponsors/colinhacks","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/
|
|
5
|
+
/***/ 381:
|
|
6
6
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
7
7
|
|
|
8
8
|
|
|
@@ -32,8 +32,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
33
33
|
exports.isValidationErrorLike = exports.isValidationError = exports.toValidationError = exports.fromZodError = exports.ValidationError = void 0;
|
|
34
34
|
const zod = __importStar(__nccwpck_require__(934));
|
|
35
|
-
const joinPath_1 = __nccwpck_require__(
|
|
36
|
-
const NonEmptyArray_1 = __nccwpck_require__(
|
|
35
|
+
const joinPath_1 = __nccwpck_require__(954);
|
|
36
|
+
const NonEmptyArray_1 = __nccwpck_require__(978);
|
|
37
37
|
class ValidationError extends Error {
|
|
38
38
|
details;
|
|
39
39
|
name;
|
|
@@ -104,7 +104,7 @@ exports.isValidationErrorLike = isValidationErrorLike;
|
|
|
104
104
|
|
|
105
105
|
/***/ }),
|
|
106
106
|
|
|
107
|
-
/***/
|
|
107
|
+
/***/ 978:
|
|
108
108
|
/***/ ((__unused_webpack_module, exports) => {
|
|
109
109
|
|
|
110
110
|
|
|
@@ -118,7 +118,7 @@ exports.isNonEmptyArray = isNonEmptyArray;
|
|
|
118
118
|
|
|
119
119
|
/***/ }),
|
|
120
120
|
|
|
121
|
-
/***/
|
|
121
|
+
/***/ 954:
|
|
122
122
|
/***/ ((__unused_webpack_module, exports) => {
|
|
123
123
|
|
|
124
124
|
|
|
@@ -203,7 +203,7 @@ var exports = __webpack_exports__;
|
|
|
203
203
|
|
|
204
204
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
205
205
|
exports.fromZodError = exports.isValidationErrorLike = exports.isValidationError = exports.toValidationError = exports.ValidationError = void 0;
|
|
206
|
-
var ValidationError_1 = __nccwpck_require__(
|
|
206
|
+
var ValidationError_1 = __nccwpck_require__(381);
|
|
207
207
|
Object.defineProperty(exports, "ValidationError", ({ enumerable: true, get: function () { return ValidationError_1.ValidationError; } }));
|
|
208
208
|
Object.defineProperty(exports, "toValidationError", ({ enumerable: true, get: function () { return ValidationError_1.toValidationError; } }));
|
|
209
209
|
Object.defineProperty(exports, "isValidationError", ({ enumerable: true, get: function () { return ValidationError_1.isValidationError; } }));
|
package/dist/Compilation.d.ts
CHANGED
|
@@ -13,20 +13,21 @@ import * as liteTapable from "@rspack/lite-tapable";
|
|
|
13
13
|
import type { Source } from "../compiled/webpack-sources";
|
|
14
14
|
import { Chunk } from "./Chunk";
|
|
15
15
|
import { ChunkGraph } from "./ChunkGraph";
|
|
16
|
+
import { ChunkGroup } from "./ChunkGroup";
|
|
16
17
|
import type { Compiler } from "./Compiler";
|
|
17
18
|
import type { ContextModuleFactory } from "./ContextModuleFactory";
|
|
18
19
|
import { Entrypoint } from "./Entrypoint";
|
|
19
20
|
import { type CodeGenerationResult, Module } from "./Module";
|
|
20
21
|
import type { NormalModuleFactory } from "./NormalModuleFactory";
|
|
21
22
|
import type { ResolverFactory } from "./ResolverFactory";
|
|
23
|
+
import { type RspackError } from "./RspackError";
|
|
22
24
|
import { Stats, type StatsAsset, type StatsError, type StatsModule } from "./Stats";
|
|
23
25
|
import type { Filename, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from "./config";
|
|
24
26
|
import { Logger } from "./logging/Logger";
|
|
25
27
|
import { StatsFactory } from "./stats/StatsFactory";
|
|
26
28
|
import { StatsPrinter } from "./stats/StatsPrinter";
|
|
27
29
|
import { type AssetInfo } from "./util/AssetInfo";
|
|
28
|
-
import Hash
|
|
29
|
-
import { type RspackError } from "./RspackError";
|
|
30
|
+
import type Hash from "./util/hash";
|
|
30
31
|
export { type AssetInfo } from "./util/AssetInfo";
|
|
31
32
|
export type Assets = Record<string, Source>;
|
|
32
33
|
export interface Asset {
|
|
@@ -41,6 +42,10 @@ export interface LogEntry {
|
|
|
41
42
|
time?: number;
|
|
42
43
|
trace?: string[];
|
|
43
44
|
}
|
|
45
|
+
export type RuntimeModule = liteTapable.SyncHook<[
|
|
46
|
+
JsRuntimeModule,
|
|
47
|
+
Chunk
|
|
48
|
+
], void>;
|
|
44
49
|
export interface CompilationParams {
|
|
45
50
|
normalModuleFactory: NormalModuleFactory;
|
|
46
51
|
contextModuleFactory: ContextModuleFactory;
|
|
@@ -143,7 +148,7 @@ export declare class Compilation {
|
|
|
143
148
|
Chunk,
|
|
144
149
|
Set<string>
|
|
145
150
|
], void>;
|
|
146
|
-
runtimeModule:
|
|
151
|
+
runtimeModule: RuntimeModule;
|
|
147
152
|
afterSeal: liteTapable.AsyncSeriesHook<[], void>;
|
|
148
153
|
}>;
|
|
149
154
|
name?: string;
|
|
@@ -172,6 +177,13 @@ export declare class Compilation {
|
|
|
172
177
|
* Get a map of all entrypoints.
|
|
173
178
|
*/
|
|
174
179
|
get entrypoints(): ReadonlyMap<string, Entrypoint>;
|
|
180
|
+
get chunkGroups(): ReadonlyArray<ChunkGroup>;
|
|
181
|
+
/**
|
|
182
|
+
* Get the named chunk groups.
|
|
183
|
+
*
|
|
184
|
+
* Note: This is a proxy for webpack internal API, only method `get` and `keys` are supported now.
|
|
185
|
+
*/
|
|
186
|
+
get namedChunkGroups(): ReadonlyMap<string, Readonly<ChunkGroup>>;
|
|
175
187
|
get modules(): ReadonlySet<Module>;
|
|
176
188
|
get chunks(): ReadonlySet<Chunk>;
|
|
177
189
|
/**
|
|
@@ -207,6 +219,12 @@ export declare class Compilation {
|
|
|
207
219
|
* @param assetInfo - extra asset information
|
|
208
220
|
*/
|
|
209
221
|
emitAsset(filename: string, source: Source, assetInfo?: AssetInfo): void;
|
|
222
|
+
/**
|
|
223
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
224
|
+
*
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
__internal__emit_asset_from_loader(filename: string, source: Source, assetInfo: AssetInfo, module: string): void;
|
|
210
228
|
deleteAsset(filename: string): void;
|
|
211
229
|
renameAsset(filename: string, newFilename: string): void;
|
|
212
230
|
/**
|
package/dist/Compilation.js
CHANGED
|
@@ -36,16 +36,18 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
36
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
|
-
var _Compilation_instances, _Compilation_inner,
|
|
39
|
+
var _Compilation_instances, _Compilation_inner, _Compilation_customModules, _Compilation_createCachedAssets, _Compilation_rebuildModuleCaller;
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Compilation = void 0;
|
|
42
42
|
const binding_1 = require("@rspack/binding");
|
|
43
43
|
const liteTapable = __importStar(require("@rspack/lite-tapable"));
|
|
44
44
|
const Chunk_1 = require("./Chunk");
|
|
45
45
|
const ChunkGraph_1 = require("./ChunkGraph");
|
|
46
|
+
const ChunkGroup_1 = require("./ChunkGroup");
|
|
46
47
|
const Entrypoint_1 = require("./Entrypoint");
|
|
47
48
|
const ErrorHelpers_1 = require("./ErrorHelpers");
|
|
48
49
|
const Module_1 = require("./Module");
|
|
50
|
+
const RspackError_1 = require("./RspackError");
|
|
49
51
|
const Stats_1 = require("./Stats");
|
|
50
52
|
const Logger_1 = require("./logging/Logger");
|
|
51
53
|
const StatsFactory_1 = require("./stats/StatsFactory");
|
|
@@ -55,13 +57,10 @@ const MergeCaller_1 = __importDefault(require("./util/MergeCaller"));
|
|
|
55
57
|
const fake_1 = require("./util/fake");
|
|
56
58
|
const memoize_1 = require("./util/memoize");
|
|
57
59
|
const source_1 = require("./util/source");
|
|
58
|
-
const RspackError_1 = require("./RspackError");
|
|
59
60
|
class Compilation {
|
|
60
61
|
constructor(compiler, inner) {
|
|
61
62
|
_Compilation_instances.add(this);
|
|
62
63
|
_Compilation_inner.set(this, void 0);
|
|
63
|
-
_Compilation_cachedAssets.set(this, void 0);
|
|
64
|
-
_Compilation_cachedEntrypoints.set(this, void 0);
|
|
65
64
|
this.fileSystemInfo = {
|
|
66
65
|
createSnapshot() {
|
|
67
66
|
// fake implement to support html-webpack-plugin
|
|
@@ -180,22 +179,38 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
180
179
|
* Get a map of all assets.
|
|
181
180
|
*/
|
|
182
181
|
get assets() {
|
|
183
|
-
|
|
184
|
-
__classPrivateFieldSet(this, _Compilation_cachedAssets, __classPrivateFieldGet(this, _Compilation_instances, "m", _Compilation_createCachedAssets).call(this), "f");
|
|
185
|
-
}
|
|
186
|
-
return __classPrivateFieldGet(this, _Compilation_cachedAssets, "f");
|
|
182
|
+
return (0, memoize_1.memoizeValue)(() => __classPrivateFieldGet(this, _Compilation_instances, "m", _Compilation_createCachedAssets).call(this));
|
|
187
183
|
}
|
|
188
184
|
/**
|
|
189
185
|
* Get a map of all entrypoints.
|
|
190
186
|
*/
|
|
191
187
|
get entrypoints() {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return __classPrivateFieldGet(this,
|
|
188
|
+
return (0, memoize_1.memoizeValue)(() => new Map(Object.entries(__classPrivateFieldGet(this, _Compilation_inner, "f").entrypoints).map(([n, e]) => [
|
|
189
|
+
n,
|
|
190
|
+
Entrypoint_1.Entrypoint.__from_binding(e, __classPrivateFieldGet(this, _Compilation_inner, "f"))
|
|
191
|
+
])));
|
|
192
|
+
}
|
|
193
|
+
get chunkGroups() {
|
|
194
|
+
return (0, memoize_1.memoizeValue)(() => __classPrivateFieldGet(this, _Compilation_inner, "f").chunkGroups.map(cg => ChunkGroup_1.ChunkGroup.__from_binding(cg, __classPrivateFieldGet(this, _Compilation_inner, "f"))));
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get the named chunk groups.
|
|
198
|
+
*
|
|
199
|
+
* Note: This is a proxy for webpack internal API, only method `get` and `keys` are supported now.
|
|
200
|
+
*/
|
|
201
|
+
get namedChunkGroups() {
|
|
202
|
+
return {
|
|
203
|
+
keys: () => {
|
|
204
|
+
const names = __classPrivateFieldGet(this, _Compilation_inner, "f").getNamedChunkGroupKeys();
|
|
205
|
+
return names[Symbol.iterator]();
|
|
206
|
+
},
|
|
207
|
+
get: (property) => {
|
|
208
|
+
if (typeof property === "string") {
|
|
209
|
+
const chunk = __classPrivateFieldGet(this, _Compilation_inner, "f").getNamedChunkGroup(property) || undefined;
|
|
210
|
+
return chunk && ChunkGroup_1.ChunkGroup.__from_binding(chunk, __classPrivateFieldGet(this, _Compilation_inner, "f"));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
199
214
|
}
|
|
200
215
|
get modules() {
|
|
201
216
|
return (0, memoize_1.memoizeValue)(() => new Set(this.__internal__getModules().map(item => Module_1.Module.__from_binding(item, this))));
|
|
@@ -259,11 +274,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
259
274
|
this.hooks.statsNormalize.call(options, context);
|
|
260
275
|
return options;
|
|
261
276
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return options;
|
|
266
|
-
}
|
|
277
|
+
const options = {};
|
|
278
|
+
this.hooks.statsNormalize.call(options, context);
|
|
279
|
+
return options;
|
|
267
280
|
}
|
|
268
281
|
createStatsFactory(options) {
|
|
269
282
|
const statsFactory = new StatsFactory_1.StatsFactory();
|
|
@@ -306,6 +319,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
306
319
|
emitAsset(filename, source, assetInfo) {
|
|
307
320
|
__classPrivateFieldGet(this, _Compilation_inner, "f").emitAsset(filename, source_1.JsSource.__to_binding(source), AssetInfo_1.JsAssetInfo.__to_binding(assetInfo));
|
|
308
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
324
|
+
*
|
|
325
|
+
* @internal
|
|
326
|
+
*/
|
|
327
|
+
__internal__emit_asset_from_loader(filename, source, assetInfo, module) {
|
|
328
|
+
__classPrivateFieldGet(this, _Compilation_inner, "f").emitAssetFromLoader(filename, source_1.JsSource.__to_binding(source), AssetInfo_1.JsAssetInfo.__to_binding(assetInfo), module);
|
|
329
|
+
}
|
|
309
330
|
deleteAsset(filename) {
|
|
310
331
|
__classPrivateFieldGet(this, _Compilation_inner, "f").deleteAsset(filename);
|
|
311
332
|
}
|
|
@@ -411,12 +432,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
411
432
|
}
|
|
412
433
|
}
|
|
413
434
|
];
|
|
414
|
-
|
|
435
|
+
for (const item of proxyMethod) {
|
|
415
436
|
const proxyedMethod = new Proxy(errors[item.method], {
|
|
416
437
|
apply: item.handler
|
|
417
438
|
});
|
|
418
439
|
errors[item.method] = proxyedMethod;
|
|
419
|
-
}
|
|
440
|
+
}
|
|
420
441
|
return errors;
|
|
421
442
|
}
|
|
422
443
|
get warnings() {
|
|
@@ -476,12 +497,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
476
497
|
}
|
|
477
498
|
}
|
|
478
499
|
];
|
|
479
|
-
|
|
500
|
+
for (const item of proxyMethod) {
|
|
480
501
|
const proxyedMethod = new Proxy(warnings[item.method], {
|
|
481
502
|
apply: item.handler
|
|
482
503
|
});
|
|
483
504
|
warnings[item.method] = proxyedMethod;
|
|
484
|
-
}
|
|
505
|
+
}
|
|
485
506
|
return warnings;
|
|
486
507
|
}
|
|
487
508
|
getPath(filename, data = {}) {
|
|
@@ -563,34 +584,28 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
563
584
|
return `${name}/${childName}`;
|
|
564
585
|
});
|
|
565
586
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
throw new TypeError("Compilation.getLogger(name) called with a function not returning a name");
|
|
572
|
-
}
|
|
587
|
+
return this.getLogger(() => {
|
|
588
|
+
if (typeof name === "function") {
|
|
589
|
+
name = name();
|
|
590
|
+
if (!name) {
|
|
591
|
+
throw new TypeError("Compilation.getLogger(name) called with a function not returning a name");
|
|
573
592
|
}
|
|
574
|
-
|
|
575
|
-
}
|
|
576
|
-
}
|
|
593
|
+
}
|
|
594
|
+
return `${name}/${childName}`;
|
|
595
|
+
});
|
|
577
596
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
throw new TypeError("Logger.getChildLogger(name) called with a function not returning a name");
|
|
585
|
-
}
|
|
597
|
+
if (typeof childName === "function") {
|
|
598
|
+
return this.getLogger(() => {
|
|
599
|
+
if (typeof childName === "function") {
|
|
600
|
+
childName = childName();
|
|
601
|
+
if (!childName) {
|
|
602
|
+
throw new TypeError("Logger.getChildLogger(name) called with a function not returning a name");
|
|
586
603
|
}
|
|
587
|
-
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
return this.getLogger(`${name}/${childName}`);
|
|
592
|
-
}
|
|
604
|
+
}
|
|
605
|
+
return `${name}/${childName}`;
|
|
606
|
+
});
|
|
593
607
|
}
|
|
608
|
+
return this.getLogger(`${name}/${childName}`);
|
|
594
609
|
});
|
|
595
610
|
}
|
|
596
611
|
getStats() {
|
|
@@ -687,7 +702,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
687
702
|
seal() { }
|
|
688
703
|
unseal() { }
|
|
689
704
|
}
|
|
690
|
-
_Compilation_inner = new WeakMap(),
|
|
705
|
+
_Compilation_inner = new WeakMap(), _Compilation_customModules = new WeakMap(), _Compilation_rebuildModuleCaller = new WeakMap(), _Compilation_instances = new WeakSet(), _Compilation_createCachedAssets = function _Compilation_createCachedAssets() {
|
|
691
706
|
return new Proxy({}, {
|
|
692
707
|
get: (_, property) => {
|
|
693
708
|
if (typeof property === "string") {
|
package/dist/Compiler.js
CHANGED
|
@@ -233,34 +233,28 @@ class Compiler {
|
|
|
233
233
|
return `${name}/${childName}`;
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
throw new TypeError("Compiler.getInfrastructureLogger(name) called with a function not returning a name");
|
|
242
|
-
}
|
|
236
|
+
return this.getInfrastructureLogger(() => {
|
|
237
|
+
if (typeof name === "function") {
|
|
238
|
+
name = name();
|
|
239
|
+
if (!name) {
|
|
240
|
+
throw new TypeError("Compiler.getInfrastructureLogger(name) called with a function not returning a name");
|
|
243
241
|
}
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
}
|
|
242
|
+
}
|
|
243
|
+
return `${name}/${childName}`;
|
|
244
|
+
});
|
|
247
245
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
throw new TypeError("Logger.getChildLogger(name) called with a function not returning a name");
|
|
255
|
-
}
|
|
246
|
+
if (typeof childName === "function") {
|
|
247
|
+
return this.getInfrastructureLogger(() => {
|
|
248
|
+
if (typeof childName === "function") {
|
|
249
|
+
childName = childName();
|
|
250
|
+
if (!childName) {
|
|
251
|
+
throw new TypeError("Logger.getChildLogger(name) called with a function not returning a name");
|
|
256
252
|
}
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
return this.getInfrastructureLogger(`${name}/${childName}`);
|
|
262
|
-
}
|
|
253
|
+
}
|
|
254
|
+
return `${name}/${childName}`;
|
|
255
|
+
});
|
|
263
256
|
}
|
|
257
|
+
return this.getInfrastructureLogger(`${name}/${childName}`);
|
|
264
258
|
});
|
|
265
259
|
}
|
|
266
260
|
/**
|
|
@@ -322,9 +316,7 @@ class Compiler {
|
|
|
322
316
|
if (err) {
|
|
323
317
|
return finalCallback(err);
|
|
324
318
|
}
|
|
325
|
-
|
|
326
|
-
return finalCallback(null, stats);
|
|
327
|
-
}
|
|
319
|
+
return finalCallback(null, stats);
|
|
328
320
|
});
|
|
329
321
|
});
|
|
330
322
|
});
|
|
@@ -632,7 +624,9 @@ _Compiler_instance = new WeakMap(), _Compiler_initial = new WeakMap(), _Compiler
|
|
|
632
624
|
},
|
|
633
625
|
require: __webpack_require__
|
|
634
626
|
};
|
|
635
|
-
|
|
627
|
+
for (const handler of interceptModuleExecution) {
|
|
628
|
+
handler(execOptions);
|
|
629
|
+
}
|
|
636
630
|
const result = codegenResults.map[id]["build time"];
|
|
637
631
|
const moduleObject = execOptions.module;
|
|
638
632
|
if (id)
|
|
@@ -660,6 +654,9 @@ _Compiler_instance = new WeakMap(), _Compiler_initial = new WeakMap(), _Compiler
|
|
|
660
654
|
registerCompilationOptimizeTreeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationOptimizeTree, () => __classPrivateFieldGet(this, _Compiler_compilation, "f").hooks.optimizeTree, queried => async () => await queried.promise(__classPrivateFieldGet(this, _Compiler_compilation, "f").chunks, __classPrivateFieldGet(this, _Compiler_compilation, "f").modules)),
|
|
661
655
|
registerCompilationOptimizeChunkModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationOptimizeChunkModules, () => __classPrivateFieldGet(this, _Compiler_compilation, "f").hooks.optimizeChunkModules, queried => async () => await queried.promise(__classPrivateFieldGet(this, _Compiler_compilation, "f").chunks, __classPrivateFieldGet(this, _Compiler_compilation, "f").modules)),
|
|
662
656
|
registerCompilationChunkHashTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationChunkHash, () => __classPrivateFieldGet(this, _Compiler_compilation, "f").hooks.chunkHash, queried => (chunk) => {
|
|
657
|
+
if (!this.options.output.hashFunction) {
|
|
658
|
+
throw new Error("'output.hashFunction' cannot be undefined");
|
|
659
|
+
}
|
|
663
660
|
const hash = (0, createHash_1.createHash)(this.options.output.hashFunction);
|
|
664
661
|
queried.call(Chunk_1.Chunk.__from_binding(chunk, __classPrivateFieldGet(this, _Compiler_compilation, "f")), hash);
|
|
665
662
|
const digestResult = hash.digest(this.options.output.hashDigest);
|
|
@@ -779,6 +776,9 @@ _Compiler_instance = new WeakMap(), _Compiler_initial = new WeakMap(), _Compiler
|
|
|
779
776
|
}),
|
|
780
777
|
registerJavascriptModulesChunkHashTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.JavascriptModulesChunkHash, () => builtin_plugin_1.JavascriptModulesPlugin.getCompilationHooks(__classPrivateFieldGet(this, _Compiler_compilation, "f"))
|
|
781
778
|
.chunkHash, queried => (chunk) => {
|
|
779
|
+
if (!this.options.output.hashFunction) {
|
|
780
|
+
throw new Error("'output.hashFunction' cannot be undefined");
|
|
781
|
+
}
|
|
782
782
|
const hash = (0, createHash_1.createHash)(this.options.output.hashFunction);
|
|
783
783
|
queried.call(Chunk_1.Chunk.__from_binding(chunk, __classPrivateFieldGet(this, _Compiler_compilation, "f")), hash);
|
|
784
784
|
const digestResult = hash.digest(this.options.output.hashDigest);
|
package/dist/ErrorHelpers.js
CHANGED
|
@@ -42,10 +42,8 @@ const cutOffMessage = (stack, message) => {
|
|
|
42
42
|
if (nextLine === -1) {
|
|
43
43
|
return stack === message ? "" : stack;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return firstLine === message ? stack.slice(nextLine + 1) : stack;
|
|
48
|
-
}
|
|
45
|
+
const firstLine = stack.slice(0, nextLine);
|
|
46
|
+
return firstLine === message ? stack.slice(nextLine + 1) : stack;
|
|
49
47
|
};
|
|
50
48
|
exports.cutOffMessage = cutOffMessage;
|
|
51
49
|
const cleanUp = (stack, message) => {
|
package/dist/Module.js
CHANGED
|
@@ -40,9 +40,7 @@ class Module {
|
|
|
40
40
|
__classPrivateFieldSet(this, _Module_originalSource, source_1.JsSource.__from_binding(__classPrivateFieldGet(this, _Module_inner, "f").originalSource), "f");
|
|
41
41
|
return __classPrivateFieldGet(this, _Module_originalSource, "f");
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
43
|
+
return null;
|
|
46
44
|
}
|
|
47
45
|
identifier() {
|
|
48
46
|
return __classPrivateFieldGet(this, _Module_inner, "f").moduleIdentifier;
|
|
@@ -51,9 +49,7 @@ class Module {
|
|
|
51
49
|
if (typeof __classPrivateFieldGet(this, _Module_inner, "f").nameForCondition === "string") {
|
|
52
50
|
return __classPrivateFieldGet(this, _Module_inner, "f").nameForCondition;
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
52
|
+
return null;
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
55
|
exports.Module = Module;
|
|
@@ -1,117 +1,93 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export type WebAssemblyModuleTypes = "webassembly/async" | "webassembly/sync";
|
|
4
|
-
export type CSSModuleTypes = "css" | "css/global" | "css/module";
|
|
5
|
-
export type AssetModuleTypes = "asset" | "asset/inline" | "asset/resource" | "asset/source" | "asset/raw-data-url";
|
|
6
|
-
export type WebpackModuleTypes = "runtime" | "fallback-module" | "remote-module" | "provide-module" | "consume-shared-module" | "lazy-compilation-proxy";
|
|
7
|
-
export type UnknownModuleTypes = string;
|
|
8
|
-
export type ModuleTypes = JavaScriptModuleTypes | JSONModuleType | WebAssemblyModuleTypes | CSSModuleTypes | AssetModuleTypes | WebpackModuleTypes | UnknownModuleTypes;
|
|
9
|
-
/**
|
|
10
|
-
* @type {Readonly<"asset">}
|
|
11
|
-
* This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096).
|
|
12
|
-
*/
|
|
13
|
-
export const ASSET_MODULE_TYPE: Readonly<"asset">;
|
|
14
|
-
/**
|
|
15
|
-
* @type {Readonly<"asset/raw-data-url">}
|
|
16
|
-
* TODO: Document what this asset type is for. See css-loader tests for its usage.
|
|
17
|
-
*/
|
|
18
|
-
export const ASSET_MODULE_TYPE_RAW_DATA_URL: Readonly<"asset/raw-data-url">;
|
|
19
|
-
/**
|
|
20
|
-
* @type {Readonly<"asset/source">}
|
|
21
|
-
* This is the module type used for assets that are imported as source code. This is the equivalent of `raw-loader`.
|
|
22
|
-
*/
|
|
23
|
-
export const ASSET_MODULE_TYPE_SOURCE: Readonly<"asset/source">;
|
|
24
|
-
/**
|
|
25
|
-
* @type {Readonly<"asset/resource">}
|
|
26
|
-
* This is the module type used for assets that are copied to the output directory. This is the equivalent of `file-loader`.
|
|
27
|
-
*/
|
|
28
|
-
export const ASSET_MODULE_TYPE_RESOURCE: Readonly<"asset/resource">;
|
|
29
|
-
/**
|
|
30
|
-
* @type {Readonly<"asset/inline">}
|
|
31
|
-
* This is the module type used for assets that are inlined as a data URI. This is the equivalent of `url-loader`.
|
|
32
|
-
*/
|
|
33
|
-
export const ASSET_MODULE_TYPE_INLINE: Readonly<"asset/inline">;
|
|
34
|
-
/**
|
|
35
|
-
* @type {Readonly<"javascript/auto">}
|
|
36
|
-
*/
|
|
37
|
-
export const JAVASCRIPT_MODULE_TYPE_AUTO: Readonly<"javascript/auto">;
|
|
1
|
+
export declare const JAVASCRIPT_MODULE_TYPE_AUTO = "javascript/auto";
|
|
2
|
+
export declare const JAVASCRIPT_MODULE_TYPE_DYNAMIC = "javascript/dynamic";
|
|
38
3
|
/**
|
|
39
|
-
* @type {Readonly<"javascript/dynamic">}
|
|
40
|
-
*/
|
|
41
|
-
export const JAVASCRIPT_MODULE_TYPE_DYNAMIC: Readonly<"javascript/dynamic">;
|
|
42
|
-
/**
|
|
43
|
-
* @type {Readonly<"javascript/esm">}
|
|
44
4
|
* This is the module type used for _strict_ ES Module syntax. This means that all legacy formats
|
|
45
5
|
* that webpack supports (CommonJS, AMD, SystemJS) are not supported.
|
|
46
6
|
*/
|
|
47
|
-
export const JAVASCRIPT_MODULE_TYPE_ESM
|
|
7
|
+
export declare const JAVASCRIPT_MODULE_TYPE_ESM = "javascript/esm";
|
|
48
8
|
/**
|
|
49
|
-
* @type {Readonly<"json">}
|
|
50
9
|
* This is the module type used for JSON files. JSON files are always parsed as ES Module.
|
|
51
10
|
*/
|
|
52
|
-
export const JSON_MODULE_TYPE
|
|
11
|
+
export declare const JSON_MODULE_TYPE = "json";
|
|
53
12
|
/**
|
|
54
|
-
* @type {Readonly<"webassembly/async">}
|
|
55
13
|
* This is the module type used for WebAssembly modules. In webpack 5 they are always treated as async modules.
|
|
56
14
|
*
|
|
57
15
|
*/
|
|
58
|
-
export const WEBASSEMBLY_MODULE_TYPE_ASYNC
|
|
16
|
+
export declare const WEBASSEMBLY_MODULE_TYPE_ASYNC = "webassembly/async";
|
|
59
17
|
/**
|
|
60
|
-
* @type {Readonly<"webassembly/sync">}
|
|
61
18
|
* This is the module type used for WebAssembly modules. In webpack 4 they are always treated as sync modules.
|
|
62
19
|
* There is a legacy option to support this usage in webpack 5 and up.
|
|
63
20
|
*/
|
|
64
|
-
export const WEBASSEMBLY_MODULE_TYPE_SYNC
|
|
21
|
+
export declare const WEBASSEMBLY_MODULE_TYPE_SYNC = "webassembly/sync";
|
|
65
22
|
/**
|
|
66
|
-
* @type {Readonly<"css">}
|
|
67
23
|
* This is the module type used for CSS files.
|
|
68
24
|
*/
|
|
69
|
-
export const CSS_MODULE_TYPE
|
|
25
|
+
export declare const CSS_MODULE_TYPE = "css";
|
|
70
26
|
/**
|
|
71
|
-
* @type {Readonly<"css/global">}
|
|
72
27
|
* This is the module type used for CSS modules files where you need to use `:local` in selector list to hash classes.
|
|
73
28
|
*/
|
|
74
|
-
export const CSS_MODULE_TYPE_GLOBAL
|
|
29
|
+
export declare const CSS_MODULE_TYPE_GLOBAL = "css/global";
|
|
75
30
|
/**
|
|
76
|
-
* @type {Readonly<"css/module">}
|
|
77
31
|
* This is the module type used for CSS modules files, by default all classes are hashed.
|
|
78
32
|
*/
|
|
79
|
-
export const CSS_MODULE_TYPE_MODULE
|
|
33
|
+
export declare const CSS_MODULE_TYPE_MODULE = "css/module";
|
|
80
34
|
/**
|
|
81
|
-
* @type {Readonly<"css/auto">}
|
|
82
35
|
* This is the module type used for CSS files, the module will be parsed as CSS modules if it's filename contains `.module.` or `.modules.`.
|
|
83
36
|
*/
|
|
84
|
-
export const CSS_MODULE_TYPE_AUTO
|
|
37
|
+
export declare const CSS_MODULE_TYPE_AUTO = "css/auto";
|
|
38
|
+
/**
|
|
39
|
+
* This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096).
|
|
40
|
+
*/
|
|
41
|
+
export declare const ASSET_MODULE_TYPE = "asset";
|
|
42
|
+
/**
|
|
43
|
+
* This is the module type used for assets that are inlined as a data URI. This is the equivalent of `url-loader`.
|
|
44
|
+
*/
|
|
45
|
+
export declare const ASSET_MODULE_TYPE_INLINE = "asset/inline";
|
|
46
|
+
/**
|
|
47
|
+
* This is the module type used for assets that are copied to the output directory. This is the equivalent of `file-loader`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ASSET_MODULE_TYPE_RESOURCE = "asset/resource";
|
|
50
|
+
/**
|
|
51
|
+
* @type {Readonly<"asset/source">}
|
|
52
|
+
* This is the module type used for assets that are imported as source code. This is the equivalent of `raw-loader`.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ASSET_MODULE_TYPE_SOURCE = "asset/source";
|
|
55
|
+
/**
|
|
56
|
+
* TODO: Document what this asset type is for. See css-loader tests for its usage.
|
|
57
|
+
*/
|
|
58
|
+
export declare const ASSET_MODULE_TYPE_RAW_DATA_URL = "asset/raw-data-url";
|
|
85
59
|
/**
|
|
86
|
-
* @type {Readonly<"runtime">}
|
|
87
60
|
* This is the module type used for the webpack runtime abstractions.
|
|
88
61
|
*/
|
|
89
|
-
export const WEBPACK_MODULE_TYPE_RUNTIME
|
|
62
|
+
export declare const WEBPACK_MODULE_TYPE_RUNTIME = "runtime";
|
|
90
63
|
/**
|
|
91
|
-
* @type {Readonly<"fallback-module">}
|
|
92
64
|
* This is the module type used for the ModuleFederation feature's FallbackModule class.
|
|
93
65
|
* TODO: Document this better.
|
|
94
66
|
*/
|
|
95
|
-
export const WEBPACK_MODULE_TYPE_FALLBACK
|
|
67
|
+
export declare const WEBPACK_MODULE_TYPE_FALLBACK = "fallback-module";
|
|
96
68
|
/**
|
|
97
|
-
* @type {Readonly<"remote-module">}
|
|
98
69
|
* This is the module type used for the ModuleFederation feature's RemoteModule class.
|
|
99
70
|
* TODO: Document this better.
|
|
100
71
|
*/
|
|
101
|
-
export const WEBPACK_MODULE_TYPE_REMOTE
|
|
72
|
+
export declare const WEBPACK_MODULE_TYPE_REMOTE = "remote-module";
|
|
102
73
|
/**
|
|
103
|
-
* @type {Readonly<"provide-module">}
|
|
104
74
|
* This is the module type used for the ModuleFederation feature's ProvideModule class.
|
|
105
75
|
* TODO: Document this better.
|
|
106
76
|
*/
|
|
107
|
-
export const WEBPACK_MODULE_TYPE_PROVIDE
|
|
77
|
+
export declare const WEBPACK_MODULE_TYPE_PROVIDE = "provide-module";
|
|
108
78
|
/**
|
|
109
|
-
* @type {Readonly<"consume-shared-module">}
|
|
110
79
|
* This is the module type used for the ModuleFederation feature's ConsumeSharedModule class.
|
|
111
80
|
*/
|
|
112
|
-
export const WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE
|
|
81
|
+
export declare const WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE = "consume-shared-module";
|
|
113
82
|
/**
|
|
114
|
-
* @type {Readonly<"lazy-compilation-proxy">}
|
|
115
83
|
* Module type used for `experiments.lazyCompilation` feature. See `LazyCompilationPlugin` for more information.
|
|
116
84
|
*/
|
|
117
|
-
export const WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY
|
|
85
|
+
export declare const WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY = "lazy-compilation-proxy";
|
|
86
|
+
export type JavaScriptModuleTypes = "javascript/auto" | "javascript/dynamic" | "javascript/esm";
|
|
87
|
+
export type JSONModuleType = "json";
|
|
88
|
+
export type WebAssemblyModuleTypes = "webassembly/async" | "webassembly/sync";
|
|
89
|
+
export type CSSModuleTypes = "css" | "css/global" | "css/module";
|
|
90
|
+
export type AssetModuleTypes = "asset" | "asset/inline" | "asset/resource" | "asset/source" | "asset/raw-data-url";
|
|
91
|
+
export type WebpackModuleTypes = "runtime" | "fallback-module" | "remote-module" | "provide-module" | "consume-shared-module" | "lazy-compilation-proxy";
|
|
92
|
+
export type UnknownModuleTypes = string;
|
|
93
|
+
export type ModuleTypes = JavaScriptModuleTypes | JSONModuleType | WebAssemblyModuleTypes | CSSModuleTypes | AssetModuleTypes | WebpackModuleTypes | UnknownModuleTypes;
|