@rspack/core 0.5.9 → 0.6.0-canary-f5973db-20240409131230
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 +3 -8
- package/dist/Compilation.js +6 -10
- package/dist/Compiler.d.ts +3 -8
- package/dist/Compiler.js +165 -144
- package/dist/ContextModuleFactory.d.ts +4 -8
- package/dist/ContextModuleFactory.js +26 -3
- package/dist/ExecuteModulePlugin.js +2 -2
- package/dist/Module.d.ts +20 -1
- package/dist/Module.js +1 -0
- package/dist/NormalModuleFactory.d.ts +8 -23
- package/dist/NormalModuleFactory.js +6 -4
- package/dist/Stats.js +2 -2
- package/dist/builtin-plugin/APIPlugin.d.ts +10 -0
- package/dist/builtin-plugin/APIPlugin.js +6 -0
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/CssModulesPlugin.js +6 -0
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -0
- package/dist/builtin-plugin/EntryPlugin.js +3 -2
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsLoaderRspackPlugin.js +3 -1
- package/dist/builtin-plugin/SplitChunksPlugin.js +2 -1
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts +3 -0
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +222 -0
- package/dist/builtin-plugin/css-extract/hmr/normalize-url.d.ts +2 -0
- package/dist/builtin-plugin/css-extract/hmr/normalize-url.js +38 -0
- package/dist/builtin-plugin/css-extract/index.d.ts +22 -0
- package/dist/builtin-plugin/css-extract/index.js +109 -0
- package/dist/builtin-plugin/css-extract/loader-options.json +32 -0
- package/dist/builtin-plugin/css-extract/loader.d.ts +15 -0
- package/dist/builtin-plugin/css-extract/loader.js +191 -0
- package/dist/builtin-plugin/css-extract/plugin-options.json +79 -0
- package/dist/builtin-plugin/css-extract/utils.d.ts +5 -0
- package/dist/builtin-plugin/css-extract/utils.js +51 -0
- package/dist/builtin-plugin/index.d.ts +4 -6
- package/dist/builtin-plugin/index.js +3 -15
- package/dist/config/adapter.js +58 -8
- package/dist/config/adapterRuleUse.d.ts +2 -2
- package/dist/config/defaults.js +65 -35
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/normalization.js +9 -1
- package/dist/config/zod.d.ts +706 -23
- package/dist/config/zod.js +47 -4
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/exports.d.ts +67 -11
- package/dist/exports.js +7 -1
- package/dist/lib/EntryOptionPlugin.js +1 -1
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +19 -0
- package/dist/lib/NormalModuleReplacementPlugin.js +75 -0
- package/dist/lite-tapable/index.d.ts +25 -0
- package/dist/lite-tapable/index.js +70 -1
- package/dist/rspackOptionsApply.d.ts +0 -1
- package/dist/rspackOptionsApply.js +8 -21
- package/dist/util/comparators.d.ts +1 -1
- package/package.json +10 -7
package/dist/Compilation.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import * as tapable from "tapable";
|
|
12
12
|
import { Source } from "webpack-sources";
|
|
13
|
-
import type { ExternalObject, JsAssetInfo,
|
|
13
|
+
import type { ExternalObject, JsAssetInfo, JsCompilation, JsModule, JsRuntimeModule, JsStatsChunk, JsStatsError, PathData } from "@rspack/binding";
|
|
14
14
|
import { RspackOptionsNormalized, StatsOptions, OutputNormalized, StatsValue, RspackPluginInstance, Filename } from "./config";
|
|
15
15
|
import * as liteTapable from "./lite-tapable";
|
|
16
16
|
import { ContextModuleFactory } from "./ContextModuleFactory";
|
|
@@ -90,6 +90,7 @@ export declare class Compilation {
|
|
|
90
90
|
ExecuteModuleContext
|
|
91
91
|
]>;
|
|
92
92
|
runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk], void>;
|
|
93
|
+
afterSeal: liteTapable.AsyncSeriesHook<[], void>;
|
|
93
94
|
};
|
|
94
95
|
options: RspackOptionsNormalized;
|
|
95
96
|
outputOptions: OutputNormalized;
|
|
@@ -141,13 +142,6 @@ export declare class Compilation {
|
|
|
141
142
|
* @param {AssetInfo | function(AssetInfo): AssetInfo} assetInfoUpdateOrFunction new asset info or function converting old to new
|
|
142
143
|
*/
|
|
143
144
|
updateAsset(filename: string, newSourceOrFunction: Source | ((source: Source) => Source), assetInfoUpdateOrFunction: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo)): void;
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
* @param moduleIdentifier moduleIdentifier of the module you want to modify
|
|
147
|
-
* @param source
|
|
148
|
-
* @returns true if the setting is success, false if failed.
|
|
149
|
-
*/
|
|
150
|
-
setNoneAstModuleSource(moduleIdentifier: string, source: JsCompatSource): boolean;
|
|
151
145
|
/**
|
|
152
146
|
* Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
|
|
153
147
|
*
|
|
@@ -174,6 +168,7 @@ export declare class Compilation {
|
|
|
174
168
|
__internal__pushNativeDiagnostics(diagnostics: ExternalObject<any>): void;
|
|
175
169
|
get errors(): {
|
|
176
170
|
push: (...errs: (Error | JsStatsError | string)[]) => void;
|
|
171
|
+
readonly length: number;
|
|
177
172
|
[Symbol.iterator](): {
|
|
178
173
|
next(): {
|
|
179
174
|
done: boolean;
|
package/dist/Compilation.js
CHANGED
|
@@ -154,7 +154,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
154
154
|
statsPrinter: new tapable.SyncHook(["statsPrinter", "options"]),
|
|
155
155
|
buildModule: new liteTapable.SyncHook(["module"]),
|
|
156
156
|
executeModule: new liteTapable.SyncHook(["options", "context"]),
|
|
157
|
-
runtimeModule: new liteTapable.SyncHook(["module", "chunk"])
|
|
157
|
+
runtimeModule: new liteTapable.SyncHook(["module", "chunk"]),
|
|
158
|
+
afterSeal: new liteTapable.AsyncSeriesHook([])
|
|
158
159
|
};
|
|
159
160
|
this.compiler = compiler;
|
|
160
161
|
this.resolverFactory = compiler.resolverFactory;
|
|
@@ -274,6 +275,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
274
275
|
options.modulesSpace || (context.forToString ? 15 : Infinity);
|
|
275
276
|
options.ids = optionOrLocalFallback(options.ids, !context.forToString);
|
|
276
277
|
options.children = optionOrLocalFallback(options.children, !context.forToString);
|
|
278
|
+
options.orphanModules = optionOrLocalFallback(options.orphanModules, context.forToString ? false : true);
|
|
277
279
|
return options;
|
|
278
280
|
}
|
|
279
281
|
createStatsFactory(options) {
|
|
@@ -312,15 +314,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
312
314
|
? jsAssetInfo => (0, util_1.toJsAssetInfo)(assetInfoUpdateOrFunction(jsAssetInfo))
|
|
313
315
|
: (0, util_1.toJsAssetInfo)(assetInfoUpdateOrFunction));
|
|
314
316
|
}
|
|
315
|
-
/**
|
|
316
|
-
*
|
|
317
|
-
* @param moduleIdentifier moduleIdentifier of the module you want to modify
|
|
318
|
-
* @param source
|
|
319
|
-
* @returns true if the setting is success, false if failed.
|
|
320
|
-
*/
|
|
321
|
-
setNoneAstModuleSource(moduleIdentifier, source) {
|
|
322
|
-
return __classPrivateFieldGet(this, _Compilation_inner, "f").setNoneAstModuleSource(moduleIdentifier, source);
|
|
323
|
-
}
|
|
324
317
|
/**
|
|
325
318
|
* Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
|
|
326
319
|
*
|
|
@@ -388,6 +381,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
388
381
|
}
|
|
389
382
|
}
|
|
390
383
|
},
|
|
384
|
+
get length() {
|
|
385
|
+
return inner.getStats().getErrors().length;
|
|
386
|
+
},
|
|
391
387
|
[Symbol.iterator]() {
|
|
392
388
|
// TODO: this is obviously a bad design, optimize this after finishing angular prototype
|
|
393
389
|
const errors = inner.getStats().getErrors();
|
package/dist/Compiler.d.ts
CHANGED
|
@@ -42,7 +42,6 @@ declare class Compiler {
|
|
|
42
42
|
};
|
|
43
43
|
compilation?: Compilation;
|
|
44
44
|
compilationParams?: CompilationParams;
|
|
45
|
-
first: boolean;
|
|
46
45
|
builtinPlugins: binding.BuiltinPlugin[];
|
|
47
46
|
root: Compiler;
|
|
48
47
|
running: boolean;
|
|
@@ -110,14 +109,10 @@ declare class Compiler {
|
|
|
110
109
|
getInfrastructureLogger(name: string | Function): Logger;
|
|
111
110
|
run(callback: Callback<Error, Stats>): void;
|
|
112
111
|
/**
|
|
113
|
-
*
|
|
112
|
+
* * Note: This is not a webpack public API, maybe removed in future.
|
|
113
|
+
* @internal
|
|
114
114
|
*/
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Safety: This method is only valid to call if the previous rebuild task is finished, or there will be data races.
|
|
118
|
-
* @deprecated This is a low-level incremental rebuild API, which shouldn't be used intentionally. Use `compiler.build` instead.
|
|
119
|
-
*/
|
|
120
|
-
rebuild(modifiedFiles?: ReadonlySet<string>, removedFiles?: ReadonlySet<string>, callback?: (error: Error | null) => void): void;
|
|
115
|
+
__internal__rebuild(modifiedFiles?: ReadonlySet<string>, removedFiles?: ReadonlySet<string>, callback?: (error: Error | null) => void): void;
|
|
121
116
|
compile(callback: Callback<Error, Compilation>): void;
|
|
122
117
|
watch(watchOptions: WatchOptions, handler: Callback<Error, Stats>): Watching;
|
|
123
118
|
purgeInputFileSystem(): void;
|
package/dist/Compiler.js
CHANGED
|
@@ -36,9 +36,19 @@ 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 _Compiler_instances, _Compiler_instance,
|
|
39
|
+
var _Compiler_instances, _Compiler_instance, _Compiler_initial, _Compiler_disabledHooks, _Compiler_nonSkippableRegisters, _Compiler_registers, _Compiler_moduleExecutionResultsMap, _Compiler_getInstance, _Compiler_updateNonSkippableRegisters, _Compiler_decorateJsTaps, _Compiler_createHookRegisterTaps, _Compiler_createHookMapRegisterTaps, _Compiler_build, _Compiler_createCompilation, _Compiler_resetThisCompilation, _Compiler_newCompilationParams;
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Compiler = void 0;
|
|
42
|
+
/**
|
|
43
|
+
* The following code is modified based on
|
|
44
|
+
* https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/Compiler.js
|
|
45
|
+
*
|
|
46
|
+
* MIT Licensed
|
|
47
|
+
* Author Tobias Koppers @sokra
|
|
48
|
+
* Copyright (c) JS Foundation and other contributors
|
|
49
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
50
|
+
*/
|
|
51
|
+
const binding = __importStar(require("@rspack/binding"));
|
|
42
52
|
const index_1 = require("./index");
|
|
43
53
|
const fs_1 = __importDefault(require("fs"));
|
|
44
54
|
const tapable = __importStar(require("tapable"));
|
|
@@ -58,9 +68,7 @@ const Logger_1 = require("./logging/Logger");
|
|
|
58
68
|
const NormalModuleFactory_1 = require("./NormalModuleFactory");
|
|
59
69
|
const bindingVersionCheck_1 = require("./util/bindingVersionCheck");
|
|
60
70
|
const Watching_1 = require("./Watching");
|
|
61
|
-
const NormalModule_1 = require("./NormalModule");
|
|
62
71
|
const builtin_plugin_1 = require("./builtin-plugin");
|
|
63
|
-
const rspackOptionsApply_1 = require("./rspackOptionsApply");
|
|
64
72
|
const defaults_1 = require("./config/defaults");
|
|
65
73
|
const assertNotNil_1 = require("./util/assertNotNil");
|
|
66
74
|
const RuntimeGlobals_1 = require("./RuntimeGlobals");
|
|
@@ -75,8 +83,10 @@ class Compiler {
|
|
|
75
83
|
_Compiler_instance.set(this, void 0);
|
|
76
84
|
this.webpack = index_1.rspack;
|
|
77
85
|
// TODO: remove this after remove rebuild on the rust side.
|
|
78
|
-
this
|
|
86
|
+
_Compiler_initial.set(this, true);
|
|
79
87
|
_Compiler_disabledHooks.set(this, void 0);
|
|
88
|
+
_Compiler_nonSkippableRegisters.set(this, void 0);
|
|
89
|
+
_Compiler_registers.set(this, void 0);
|
|
80
90
|
_Compiler_moduleExecutionResultsMap.set(this, void 0);
|
|
81
91
|
this.outputFileSystem = fs_1.default;
|
|
82
92
|
this.options = options;
|
|
@@ -132,7 +142,9 @@ class Compiler {
|
|
|
132
142
|
this.modifiedFiles = undefined;
|
|
133
143
|
this.removedFiles = undefined;
|
|
134
144
|
__classPrivateFieldSet(this, _Compiler_disabledHooks, [], "f");
|
|
145
|
+
__classPrivateFieldSet(this, _Compiler_nonSkippableRegisters, [], "f");
|
|
135
146
|
__classPrivateFieldSet(this, _Compiler_moduleExecutionResultsMap, new Map(), "f");
|
|
147
|
+
new builtin_plugin_1.JsLoaderRspackPlugin(this).apply(this);
|
|
136
148
|
new ExecuteModulePlugin_1.default().apply(this);
|
|
137
149
|
}
|
|
138
150
|
/**
|
|
@@ -373,36 +385,10 @@ class Compiler {
|
|
|
373
385
|
}
|
|
374
386
|
}
|
|
375
387
|
/**
|
|
376
|
-
*
|
|
388
|
+
* * Note: This is not a webpack public API, maybe removed in future.
|
|
389
|
+
* @internal
|
|
377
390
|
*/
|
|
378
|
-
|
|
379
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_getInstance).call(this, (error, instance) => {
|
|
380
|
-
if (error) {
|
|
381
|
-
return callback === null || callback === void 0 ? void 0 : callback(error);
|
|
382
|
-
}
|
|
383
|
-
if (!this.first) {
|
|
384
|
-
instance.rebuild(Array.from(this.modifiedFiles || []), Array.from(this.removedFiles || []), error => {
|
|
385
|
-
if (error) {
|
|
386
|
-
return callback === null || callback === void 0 ? void 0 : callback(error);
|
|
387
|
-
}
|
|
388
|
-
callback === null || callback === void 0 ? void 0 : callback(null);
|
|
389
|
-
});
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
this.first = false;
|
|
393
|
-
instance.build(error => {
|
|
394
|
-
if (error) {
|
|
395
|
-
return callback === null || callback === void 0 ? void 0 : callback(error);
|
|
396
|
-
}
|
|
397
|
-
callback === null || callback === void 0 ? void 0 : callback(null);
|
|
398
|
-
});
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Safety: This method is only valid to call if the previous rebuild task is finished, or there will be data races.
|
|
403
|
-
* @deprecated This is a low-level incremental rebuild API, which shouldn't be used intentionally. Use `compiler.build` instead.
|
|
404
|
-
*/
|
|
405
|
-
rebuild(modifiedFiles, removedFiles, callback) {
|
|
391
|
+
__internal__rebuild(modifiedFiles, removedFiles, callback) {
|
|
406
392
|
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_getInstance).call(this, (error, instance) => {
|
|
407
393
|
if (error) {
|
|
408
394
|
return callback === null || callback === void 0 ? void 0 : callback(error);
|
|
@@ -424,7 +410,7 @@ class Compiler {
|
|
|
424
410
|
}
|
|
425
411
|
this.hooks.compile.call(params);
|
|
426
412
|
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_resetThisCompilation).call(this);
|
|
427
|
-
this.
|
|
413
|
+
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_build).call(this, err => {
|
|
428
414
|
if (err) {
|
|
429
415
|
return callback(err);
|
|
430
416
|
}
|
|
@@ -457,7 +443,7 @@ class Compiler {
|
|
|
457
443
|
}
|
|
458
444
|
close(callback) {
|
|
459
445
|
if (this.watching) {
|
|
460
|
-
// When there is still an active watching, close this
|
|
446
|
+
// When there is still an active watching, close this #initial
|
|
461
447
|
this.watching.close(() => {
|
|
462
448
|
this.close(callback);
|
|
463
449
|
});
|
|
@@ -484,7 +470,7 @@ class Compiler {
|
|
|
484
470
|
}
|
|
485
471
|
}
|
|
486
472
|
exports.Compiler = Compiler;
|
|
487
|
-
_Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Compiler_moduleExecutionResultsMap = new WeakMap(), _Compiler_instances = new WeakSet(), _Compiler_getInstance = function _Compiler_getInstance(callback) {
|
|
473
|
+
_Compiler_instance = new WeakMap(), _Compiler_initial = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Compiler_nonSkippableRegisters = new WeakMap(), _Compiler_registers = new WeakMap(), _Compiler_moduleExecutionResultsMap = new WeakMap(), _Compiler_instances = new WeakSet(), _Compiler_getInstance = function _Compiler_getInstance(callback) {
|
|
488
474
|
const error = (0, bindingVersionCheck_1.checkVersion)();
|
|
489
475
|
if (error) {
|
|
490
476
|
return callback(error);
|
|
@@ -493,34 +479,24 @@ _Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Co
|
|
|
493
479
|
return callback(null, __classPrivateFieldGet(this, _Compiler_instance, "f"));
|
|
494
480
|
}
|
|
495
481
|
const options = this.options;
|
|
496
|
-
// TODO: remove this in v0.6
|
|
497
|
-
if (!options.experiments.rspackFuture.disableApplyEntryLazily) {
|
|
498
|
-
(0, rspackOptionsApply_1.applyEntryOptions)(this, options);
|
|
499
|
-
}
|
|
500
482
|
// TODO: remove this when drop support for builtins options
|
|
501
483
|
options.builtins = (0, builtin_plugin_1.deprecated_resolveBuiltins)(options.builtins, options);
|
|
502
484
|
const rawOptions = (0, config_1.getRawOptions)(options, this);
|
|
503
485
|
const instanceBinding = require("@rspack/binding");
|
|
504
|
-
__classPrivateFieldSet(this,
|
|
505
|
-
|
|
506
|
-
normalModuleFactoryResolveForScheme: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_normalModuleFactoryResolveForScheme).bind(this),
|
|
507
|
-
afterResolve: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_afterResolve).bind(this),
|
|
508
|
-
contextModuleFactoryBeforeResolve: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_contextModuleFactoryBeforeResolve).bind(this),
|
|
509
|
-
contextModuleFactoryAfterResolve: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_contextModuleFactoryAfterResolve).bind(this)
|
|
510
|
-
}, {
|
|
511
|
-
registerCompilerThisCompilationTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createRegisterTaps).call(this, () => this.hooks.thisCompilation, queried => (native) => {
|
|
486
|
+
__classPrivateFieldSet(this, _Compiler_registers, {
|
|
487
|
+
registerCompilerThisCompilationTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerThisCompilation, () => this.hooks.thisCompilation, queried => (native) => {
|
|
512
488
|
if (this.compilation === undefined) {
|
|
513
489
|
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createCompilation).call(this, native);
|
|
514
490
|
}
|
|
515
491
|
queried.call(this.compilation, this.compilationParams);
|
|
516
492
|
}),
|
|
517
|
-
registerCompilerCompilationTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
518
|
-
registerCompilerMakeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
519
|
-
registerCompilerFinishMakeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
520
|
-
registerCompilerShouldEmitTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
521
|
-
registerCompilerEmitTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
522
|
-
registerCompilerAfterEmitTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
523
|
-
registerCompilerAssetEmittedTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
493
|
+
registerCompilerCompilationTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerCompilation, () => this.hooks.compilation, queried => () => queried.call(this.compilation, this.compilationParams)),
|
|
494
|
+
registerCompilerMakeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerMake, () => this.hooks.make, queried => async () => await queried.promise(this.compilation)),
|
|
495
|
+
registerCompilerFinishMakeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerFinishMake, () => this.hooks.finishMake, queried => async () => await queried.promise(this.compilation)),
|
|
496
|
+
registerCompilerShouldEmitTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerShouldEmit, () => this.hooks.shouldEmit, queried => () => queried.call(this.compilation)),
|
|
497
|
+
registerCompilerEmitTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerEmit, () => this.hooks.emit, queried => async () => await queried.promise(this.compilation)),
|
|
498
|
+
registerCompilerAfterEmitTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerAfterEmit, () => this.hooks.afterEmit, queried => async () => await queried.promise(this.compilation)),
|
|
499
|
+
registerCompilerAssetEmittedTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilerAssetEmitted, () => this.hooks.assetEmitted, queried => async ({ filename, targetPath, outputPath }) => await queried.promise(filename, {
|
|
524
500
|
compilation: this.compilation,
|
|
525
501
|
targetPath,
|
|
526
502
|
outputPath,
|
|
@@ -533,7 +509,7 @@ _Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Co
|
|
|
533
509
|
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.buffer();
|
|
534
510
|
}
|
|
535
511
|
})),
|
|
536
|
-
registerCompilationRuntimeModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
512
|
+
registerCompilationRuntimeModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationRuntimeModule, () => this.compilation.hooks.runtimeModule, queried => ({ module, chunk }) => {
|
|
537
513
|
var _a, _b;
|
|
538
514
|
const originSource = (_a = module.source) === null || _a === void 0 ? void 0 : _a.source;
|
|
539
515
|
queried.call(module, Chunk_1.Chunk.__from_binding(chunk, this.compilation));
|
|
@@ -543,10 +519,10 @@ _Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Co
|
|
|
543
519
|
}
|
|
544
520
|
return;
|
|
545
521
|
}),
|
|
546
|
-
registerCompilationBuildModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
547
|
-
registerCompilationStillValidModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
548
|
-
registerCompilationSucceedModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
549
|
-
registerCompilationExecuteModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
522
|
+
registerCompilationBuildModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationBuildModule, () => this.compilation.hooks.buildModule, queired => (m) => queired.call(Module_1.Module.__from_binding(m))),
|
|
523
|
+
registerCompilationStillValidModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationStillValidModule, () => this.compilation.hooks.stillValidModule, queired => (m) => queired.call(Module_1.Module.__from_binding(m))),
|
|
524
|
+
registerCompilationSucceedModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationSucceedModule, () => this.compilation.hooks.succeedModule, queired => (m) => queired.call(Module_1.Module.__from_binding(m))),
|
|
525
|
+
registerCompilationExecuteModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationExecuteModule, () => this.compilation.hooks.executeModule, queried => ({ entry, id, codegenResults, runtimeModules }) => {
|
|
550
526
|
const __webpack_require__ = (id) => {
|
|
551
527
|
const cached = moduleCache[id];
|
|
552
528
|
if (cached !== undefined) {
|
|
@@ -584,15 +560,16 @@ _Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Co
|
|
|
584
560
|
const executeResult = __webpack_require__(entry);
|
|
585
561
|
__classPrivateFieldGet(this, _Compiler_moduleExecutionResultsMap, "f").set(id, executeResult);
|
|
586
562
|
}),
|
|
587
|
-
registerCompilationFinishModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
588
|
-
registerCompilationOptimizeModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
589
|
-
registerCompilationAfterOptimizeModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
590
|
-
registerCompilationOptimizeTreeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
591
|
-
registerCompilationOptimizeChunkModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
592
|
-
registerCompilationChunkAssetTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
593
|
-
registerCompilationProcessAssetsTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
594
|
-
registerCompilationAfterProcessAssetsTaps: __classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
595
|
-
|
|
563
|
+
registerCompilationFinishModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationFinishModules, () => this.compilation.hooks.finishModules, queried => async () => await queried.promise(this.compilation.modules)),
|
|
564
|
+
registerCompilationOptimizeModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationOptimizeModules, () => this.compilation.hooks.optimizeModules, queried => () => queried.call(this.compilation.modules)),
|
|
565
|
+
registerCompilationAfterOptimizeModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationAfterOptimizeModules, () => this.compilation.hooks.afterOptimizeModules, queried => () => queried.call(this.compilation.modules)),
|
|
566
|
+
registerCompilationOptimizeTreeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationOptimizeTree, () => this.compilation.hooks.optimizeTree, queried => async () => await queried.promise(this.compilation.chunks, this.compilation.modules)),
|
|
567
|
+
registerCompilationOptimizeChunkModulesTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationOptimizeChunkModules, () => this.compilation.hooks.optimizeChunkModules, queried => async () => await queried.promise(this.compilation.chunks, this.compilation.modules)),
|
|
568
|
+
registerCompilationChunkAssetTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationChunkAsset, () => this.compilation.hooks.chunkAsset, queried => ({ chunk, filename }) => queried.call(Chunk_1.Chunk.__from_binding(chunk, this.compilation), filename)),
|
|
569
|
+
registerCompilationProcessAssetsTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationProcessAssets, () => this.compilation.hooks.processAssets, queried => async () => await queried.promise(this.compilation.assets)),
|
|
570
|
+
registerCompilationAfterProcessAssetsTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationAfterProcessAssets, () => this.compilation.hooks.afterProcessAssets, queried => () => queried.call(this.compilation.assets)),
|
|
571
|
+
registerCompilationAfterSealTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationAfterSeal, () => this.compilation.hooks.afterSeal, queried => async () => await queried.promise()),
|
|
572
|
+
registerNormalModuleFactoryBeforeResolveTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, () => this.compilationParams.normalModuleFactory.hooks.beforeResolve, queried => async (resolveData) => {
|
|
596
573
|
const normalizedResolveData = {
|
|
597
574
|
request: resolveData.request,
|
|
598
575
|
context: resolveData.context,
|
|
@@ -604,83 +581,73 @@ _Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Co
|
|
|
604
581
|
resolveData.request = normalizedResolveData.request;
|
|
605
582
|
resolveData.context = normalizedResolveData.context;
|
|
606
583
|
return [ret, resolveData];
|
|
584
|
+
}),
|
|
585
|
+
registerNormalModuleFactoryResolveForSchemeTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookMapRegisterTaps).call(this, binding.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, () => this.compilationParams.normalModuleFactory.hooks.resolveForScheme, queried => async (args) => {
|
|
586
|
+
const ret = await queried
|
|
587
|
+
.for(args.scheme)
|
|
588
|
+
.promise(args.resourceData);
|
|
589
|
+
return [ret, args.resourceData];
|
|
590
|
+
}),
|
|
591
|
+
registerNormalModuleFactoryAfterResolveTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.NormalModuleFactoryAfterResolve, () => this.compilationParams.normalModuleFactory.hooks.afterResolve, queried => async (arg) => {
|
|
592
|
+
const data = {
|
|
593
|
+
request: arg.request,
|
|
594
|
+
context: arg.context,
|
|
595
|
+
fileDependencies: arg.fileDependencies,
|
|
596
|
+
missingDependencies: arg.missingDependencies,
|
|
597
|
+
contextDependencies: arg.contextDependencies,
|
|
598
|
+
createData: arg.createData
|
|
599
|
+
};
|
|
600
|
+
const ret = await queried.promise(data);
|
|
601
|
+
return [ret, data.createData];
|
|
602
|
+
}),
|
|
603
|
+
registerNormalModuleFactoryCreateModuleTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.NormalModuleFactoryCreateModule, () => this.compilationParams.normalModuleFactory.hooks.createModule, queried => async (args) => {
|
|
604
|
+
const data = {
|
|
605
|
+
...args,
|
|
606
|
+
settings: {}
|
|
607
|
+
};
|
|
608
|
+
await queried.promise(data, {});
|
|
609
|
+
}),
|
|
610
|
+
registerContextModuleFactoryBeforeResolveTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, () => this.compilationParams.contextModuleFactory.hooks.beforeResolve, queried => async (arg) => {
|
|
611
|
+
const data = {
|
|
612
|
+
request: arg.request,
|
|
613
|
+
context: arg.context,
|
|
614
|
+
fileDependencies: [],
|
|
615
|
+
missingDependencies: [],
|
|
616
|
+
contextDependencies: []
|
|
617
|
+
};
|
|
618
|
+
const ret = await queried.promise(data);
|
|
619
|
+
return [ret, data];
|
|
620
|
+
}),
|
|
621
|
+
registerContextModuleFactoryAfterResolveTaps: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.ContextModuleFactoryAfterResolve, () => this.compilationParams.contextModuleFactory.hooks.afterResolve, queried => async (arg) => {
|
|
622
|
+
const data = {
|
|
623
|
+
request: arg.request,
|
|
624
|
+
context: arg.context,
|
|
625
|
+
fileDependencies: arg.fileDependencies,
|
|
626
|
+
missingDependencies: arg.missingDependencies,
|
|
627
|
+
contextDependencies: arg.contextDependencies,
|
|
628
|
+
createData: arg.createData
|
|
629
|
+
};
|
|
630
|
+
return await queried.promise(data);
|
|
607
631
|
})
|
|
608
|
-
},
|
|
632
|
+
}, "f");
|
|
633
|
+
__classPrivateFieldSet(this, _Compiler_instance, new instanceBinding.Rspack(rawOptions, this.builtinPlugins, __classPrivateFieldGet(this, _Compiler_registers, "f"), (0, fileSystem_1.createThreadsafeNodeFSFromRaw)(this.outputFileSystem)), "f");
|
|
609
634
|
callback(null, __classPrivateFieldGet(this, _Compiler_instance, "f"));
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
normalModuleFactoryCreateModule: (_d = this.compilationParams) === null || _d === void 0 ? void 0 : _d.normalModuleFactory.hooks.createModule,
|
|
618
|
-
normalModuleFactoryResolveForScheme: (_e = this.compilationParams) === null || _e === void 0 ? void 0 : _e.normalModuleFactory.hooks.resolveForScheme
|
|
619
|
-
};
|
|
620
|
-
for (const [name, hook] of Object.entries(hookMap)) {
|
|
621
|
-
if (typeof hook !== "undefined" &&
|
|
622
|
-
(hook.taps
|
|
623
|
-
? !hook.isUsed()
|
|
624
|
-
: hook._map
|
|
625
|
-
? /* hook map */ hook._map.size === 0
|
|
626
|
-
: false)) {
|
|
627
|
-
disabledHooks.push(name);
|
|
635
|
+
}, _Compiler_updateNonSkippableRegisters = function _Compiler_updateNonSkippableRegisters() {
|
|
636
|
+
const kinds = [];
|
|
637
|
+
for (const { getHook, getHookMap, registerKind } of Object.values(__classPrivateFieldGet(this, _Compiler_registers, "f"))) {
|
|
638
|
+
const get = getHook !== null && getHook !== void 0 ? getHook : getHookMap;
|
|
639
|
+
const hookOrMap = get();
|
|
640
|
+
if (hookOrMap.isUsed()) {
|
|
641
|
+
kinds.push(registerKind);
|
|
628
642
|
}
|
|
629
643
|
}
|
|
630
|
-
|
|
631
|
-
if (__classPrivateFieldGet(this, _Compiler_disabledHooks, "f").join() !== disabledHooks.join()) {
|
|
644
|
+
if (__classPrivateFieldGet(this, _Compiler_nonSkippableRegisters, "f").join() !== kinds.join()) {
|
|
632
645
|
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_getInstance).call(this, (error, instance) => {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
instance.setDisabledHooks(disabledHooks);
|
|
637
|
-
__classPrivateFieldSet(this, _Compiler_disabledHooks, disabledHooks, "f");
|
|
646
|
+
instance.setNonSkippableRegisters(kinds);
|
|
647
|
+
__classPrivateFieldSet(this, _Compiler_nonSkippableRegisters, kinds, "f");
|
|
638
648
|
});
|
|
639
649
|
}
|
|
640
|
-
},
|
|
641
|
-
await this.compilation.hooks.afterProcessAssets.promise(this.compilation.assets);
|
|
642
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
643
|
-
}, _Compiler_afterResolve = async function _Compiler_afterResolve(resolveData) {
|
|
644
|
-
let res = await this.compilationParams.normalModuleFactory.hooks.afterResolve.promise(resolveData);
|
|
645
|
-
NormalModule_1.NormalModule.getCompilationHooks(this.compilation).loader.tap("sideEffectFreePropPlugin", (loaderContext) => {
|
|
646
|
-
loaderContext._module = {
|
|
647
|
-
factoryMeta: {
|
|
648
|
-
sideEffectFree: !!resolveData.factoryMeta.sideEffectFree
|
|
649
|
-
}
|
|
650
|
-
};
|
|
651
|
-
});
|
|
652
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
653
|
-
return [res, resolveData.createData];
|
|
654
|
-
}, _Compiler_contextModuleFactoryBeforeResolve = async function _Compiler_contextModuleFactoryBeforeResolve(resourceData) {
|
|
655
|
-
let res = await this.compilationParams.contextModuleFactory.hooks.beforeResolve.promise(resourceData);
|
|
656
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
657
|
-
return res;
|
|
658
|
-
}, _Compiler_contextModuleFactoryAfterResolve = async function _Compiler_contextModuleFactoryAfterResolve(resourceData) {
|
|
659
|
-
let res = await this.compilationParams.contextModuleFactory.hooks.afterResolve.promise(resourceData);
|
|
660
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
661
|
-
return res;
|
|
662
|
-
}, _Compiler_normalModuleFactoryCreateModule = async function _Compiler_normalModuleFactoryCreateModule(createData) {
|
|
663
|
-
const data = Object.assign({}, createData, {
|
|
664
|
-
settings: {},
|
|
665
|
-
matchResource: createData.resourceResolveData.resource
|
|
666
|
-
});
|
|
667
|
-
const nmfHooks = this.compilationParams.normalModuleFactory.hooks;
|
|
668
|
-
await (nmfHooks === null || nmfHooks === void 0 ? void 0 : nmfHooks.createModule.promise(data, {}));
|
|
669
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
670
|
-
}, _Compiler_normalModuleFactoryResolveForScheme = async function _Compiler_normalModuleFactoryResolveForScheme(input) {
|
|
671
|
-
let stop = await this.compilationParams.normalModuleFactory.hooks.resolveForScheme.for(input.scheme).promise(input.resourceData);
|
|
672
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
673
|
-
return {
|
|
674
|
-
resourceData: input.resourceData,
|
|
675
|
-
stop: stop === true
|
|
676
|
-
};
|
|
677
|
-
}, _Compiler_optimizeChunkModules = async function _Compiler_optimizeChunkModules() {
|
|
678
|
-
await this.compilation.hooks.optimizeChunkModules.promise(this.compilation.chunks, this.compilation.modules);
|
|
679
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
680
|
-
}, _Compiler_optimizeTree = async function _Compiler_optimizeTree() {
|
|
681
|
-
await this.compilation.hooks.optimizeTree.promise(this.compilation.chunks, this.compilation.modules);
|
|
682
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateDisabledHooks).call(this);
|
|
683
|
-
}, _Compiler_decorateUpdateDisabledHooks = function _Compiler_decorateUpdateDisabledHooks(jsTaps) {
|
|
650
|
+
}, _Compiler_decorateJsTaps = function _Compiler_decorateJsTaps(jsTaps) {
|
|
684
651
|
if (jsTaps.length > 0) {
|
|
685
652
|
const last = jsTaps[jsTaps.length - 1];
|
|
686
653
|
const old = last.function;
|
|
@@ -688,16 +655,16 @@ _Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Co
|
|
|
688
655
|
const result = old(...args);
|
|
689
656
|
if (result && typeof result.then === "function") {
|
|
690
657
|
return result.then((r) => {
|
|
691
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
658
|
+
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateNonSkippableRegisters).call(this);
|
|
692
659
|
return r;
|
|
693
660
|
});
|
|
694
661
|
}
|
|
695
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
662
|
+
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_updateNonSkippableRegisters).call(this);
|
|
696
663
|
return result;
|
|
697
664
|
};
|
|
698
665
|
}
|
|
699
|
-
},
|
|
700
|
-
|
|
666
|
+
}, _Compiler_createHookRegisterTaps = function _Compiler_createHookRegisterTaps(registerKind, getHook, createTap) {
|
|
667
|
+
const getTaps = (stages) => {
|
|
701
668
|
const hook = getHook();
|
|
702
669
|
if (!hook.isUsed())
|
|
703
670
|
return [];
|
|
@@ -719,9 +686,63 @@ _Compiler_instance = new WeakMap(), _Compiler_disabledHooks = new WeakMap(), _Co
|
|
|
719
686
|
stage: liteTapable.safeStage(from + 1)
|
|
720
687
|
});
|
|
721
688
|
}
|
|
722
|
-
__classPrivateFieldGet(this, _Compiler_instances, "m",
|
|
689
|
+
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_decorateJsTaps).call(this, jsTaps);
|
|
723
690
|
return jsTaps;
|
|
724
691
|
};
|
|
692
|
+
getTaps.registerKind = registerKind;
|
|
693
|
+
getTaps.getHook = getHook;
|
|
694
|
+
return getTaps;
|
|
695
|
+
}, _Compiler_createHookMapRegisterTaps = function _Compiler_createHookMapRegisterTaps(registerKind, getHookMap, createTap) {
|
|
696
|
+
const getTaps = (stages) => {
|
|
697
|
+
const map = getHookMap();
|
|
698
|
+
if (!map.isUsed())
|
|
699
|
+
return [];
|
|
700
|
+
const breakpoints = [
|
|
701
|
+
liteTapable.minStage,
|
|
702
|
+
...stages,
|
|
703
|
+
liteTapable.maxStage
|
|
704
|
+
];
|
|
705
|
+
const jsTaps = [];
|
|
706
|
+
for (let i = 0; i < breakpoints.length - 1; i++) {
|
|
707
|
+
const from = breakpoints[i];
|
|
708
|
+
const to = breakpoints[i + 1];
|
|
709
|
+
const stageRange = [from, to];
|
|
710
|
+
const queried = map.queryStageRange(stageRange);
|
|
711
|
+
if (!queried.isUsed())
|
|
712
|
+
continue;
|
|
713
|
+
jsTaps.push({
|
|
714
|
+
function: createTap(queried),
|
|
715
|
+
stage: liteTapable.safeStage(from + 1)
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_decorateJsTaps).call(this, jsTaps);
|
|
719
|
+
return jsTaps;
|
|
720
|
+
};
|
|
721
|
+
getTaps.registerKind = registerKind;
|
|
722
|
+
getTaps.getHookMap = getHookMap;
|
|
723
|
+
return getTaps;
|
|
724
|
+
}, _Compiler_build = function _Compiler_build(callback) {
|
|
725
|
+
__classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_getInstance).call(this, (error, instance) => {
|
|
726
|
+
if (error) {
|
|
727
|
+
return callback === null || callback === void 0 ? void 0 : callback(error);
|
|
728
|
+
}
|
|
729
|
+
if (!__classPrivateFieldGet(this, _Compiler_initial, "f")) {
|
|
730
|
+
instance.rebuild(Array.from(this.modifiedFiles || []), Array.from(this.removedFiles || []), error => {
|
|
731
|
+
if (error) {
|
|
732
|
+
return callback === null || callback === void 0 ? void 0 : callback(error);
|
|
733
|
+
}
|
|
734
|
+
callback === null || callback === void 0 ? void 0 : callback(null);
|
|
735
|
+
});
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
__classPrivateFieldSet(this, _Compiler_initial, false, "f");
|
|
739
|
+
instance.build(error => {
|
|
740
|
+
if (error) {
|
|
741
|
+
return callback === null || callback === void 0 ? void 0 : callback(error);
|
|
742
|
+
}
|
|
743
|
+
callback === null || callback === void 0 ? void 0 : callback(null);
|
|
744
|
+
});
|
|
745
|
+
});
|
|
725
746
|
}, _Compiler_createCompilation = function _Compiler_createCompilation(native) {
|
|
726
747
|
const compilation = new Compilation_1.Compilation(this, native);
|
|
727
748
|
compilation.name = this.name;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
context?: string;
|
|
4
|
-
request: string;
|
|
5
|
-
};
|
|
1
|
+
import * as liteTapable from "./lite-tapable";
|
|
2
|
+
import { ResolveData } from "./Module";
|
|
6
3
|
export declare class ContextModuleFactory {
|
|
7
4
|
hooks: {
|
|
8
|
-
beforeResolve: AsyncSeriesBailHook<[ResolveData],
|
|
9
|
-
afterResolve: AsyncSeriesBailHook<[ResolveData],
|
|
5
|
+
beforeResolve: liteTapable.AsyncSeriesBailHook<[ResolveData], false | void>;
|
|
6
|
+
afterResolve: liteTapable.AsyncSeriesBailHook<[ResolveData], false | void>;
|
|
10
7
|
};
|
|
11
8
|
constructor();
|
|
12
9
|
}
|
|
13
|
-
export {};
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.ContextModuleFactory = void 0;
|
|
4
|
-
const
|
|
27
|
+
const liteTapable = __importStar(require("./lite-tapable"));
|
|
5
28
|
class ContextModuleFactory {
|
|
6
29
|
constructor() {
|
|
7
30
|
this.hooks = {
|
|
@@ -18,8 +41,8 @@ class ContextModuleFactory {
|
|
|
18
41
|
// /** @type {AsyncSeriesBailHook<[ResolveData], Module>} */
|
|
19
42
|
// factorize: new AsyncSeriesBailHook(["resolveData"]),
|
|
20
43
|
// /** @type {AsyncSeriesBailHook<[ResolveData], false | void>} */
|
|
21
|
-
beforeResolve: new
|
|
22
|
-
afterResolve: new
|
|
44
|
+
beforeResolve: new liteTapable.AsyncSeriesBailHook(["resolveData"]),
|
|
45
|
+
afterResolve: new liteTapable.AsyncSeriesBailHook(["resolveData"])
|
|
23
46
|
// /** @type {AsyncSeriesBailHook<[ResolveData["createData"], ResolveData], Module | void>} */
|
|
24
47
|
// createModule: new AsyncSeriesBailHook(["createData", "resolveData"]),
|
|
25
48
|
// /** @type {SyncWaterfallHook<[Module, ResolveData["createData"], ResolveData], Module>} */
|