@rspack/core 1.0.9 → 1.0.11
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/Dependency.d.ts +7 -6
- package/dist/Module.d.ts +19 -17
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -0
- package/dist/config/types.d.ts +545 -0
- package/dist/config/zod.d.ts +202 -1347
- package/dist/cssExtractHmr.js +224 -0
- package/dist/cssExtractLoader.js +277 -0
- package/dist/index.js +23347 -31
- package/dist/{builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts → runtime/cssExtractHmr.d.ts} +1 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
- package/dist/stats/statsFactoryUtils.d.ts +1 -0
- package/package.json +8 -5
- package/compiled/json-parse-even-better-errors/index.d.ts +0 -1
- package/compiled/json-parse-even-better-errors/index.js +0 -193
- package/compiled/json-parse-even-better-errors/package.json +0 -1
- package/compiled/neo-async/index.d.ts +0 -685
- package/compiled/neo-async/index.js +0 -9207
- package/compiled/neo-async/license +0 -22
- package/compiled/neo-async/package.json +0 -1
- package/compiled/zod-validation-error/index.d.ts +0 -41
- package/compiled/zod-validation-error/index.js +0 -335
- package/compiled/zod-validation-error/license +0 -9
- package/compiled/zod-validation-error/package.json +0 -1
- package/dist/Chunk.js +0 -118
- package/dist/ChunkGraph.js +0 -27
- package/dist/ChunkGroup.js +0 -76
- package/dist/Compilation.js +0 -854
- package/dist/Compiler.js +0 -920
- package/dist/ContextModuleFactory.js +0 -36
- package/dist/DependenciesBlock.js +0 -30
- package/dist/Dependency.js +0 -32
- package/dist/Entrypoint.js +0 -21
- package/dist/ErrorHelpers.js +0 -62
- package/dist/ExecuteModulePlugin.js +0 -46
- package/dist/FileSystem.js +0 -34
- package/dist/FileSystemInfo.js +0 -2
- package/dist/Module.js +0 -143
- package/dist/ModuleTypeConstants.js +0 -92
- package/dist/MultiCompiler.js +0 -440
- package/dist/MultiStats.js +0 -161
- package/dist/MultiWatching.js +0 -62
- package/dist/NormalModule.js +0 -97
- package/dist/NormalModuleFactory.js +0 -43
- package/dist/Resolver.js +0 -39
- package/dist/ResolverFactory.js +0 -61
- package/dist/RspackError.js +0 -21
- package/dist/RuleSetCompiler.js +0 -10
- package/dist/RuntimeGlobals.js +0 -357
- package/dist/RuntimeModule.js +0 -58
- package/dist/Stats.js +0 -161
- package/dist/Template.js +0 -206
- package/dist/Watching.js +0 -290
- package/dist/builtin-loader/index.js +0 -17
- package/dist/builtin-loader/lightningcss/index.js +0 -175
- package/dist/builtin-loader/swc/index.js +0 -5
- package/dist/builtin-loader/swc/pluginImport.js +0 -35
- package/dist/builtin-loader/swc/react.js +0 -7
- package/dist/builtin-loader/swc/types.js +0 -2
- package/dist/builtin-plugin/APIPlugin.js +0 -6
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/AssetModulesPlugin.js +0 -6
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.js +0 -6
- package/dist/builtin-plugin/BannerPlugin.js +0 -22
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +0 -12
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.js +0 -6
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/ContextReplacementPlugin.js +0 -43
- package/dist/builtin-plugin/CopyRspackPlugin.js +0 -21
- package/dist/builtin-plugin/CssModulesPlugin.js +0 -6
- package/dist/builtin-plugin/DataUriPlugin.js +0 -6
- package/dist/builtin-plugin/DefinePlugin.js +0 -44
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/DynamicEntryPlugin.js +0 -36
- package/dist/builtin-plugin/ElectronTargetPlugin.js +0 -6
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.js +0 -6
- package/dist/builtin-plugin/EnableLibraryPlugin.js +0 -39
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.js +0 -6
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.js +0 -6
- package/dist/builtin-plugin/EntryPlugin.js +0 -34
- package/dist/builtin-plugin/EvalDevToolModulePlugin.js +0 -6
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.js +0 -16
- package/dist/builtin-plugin/ExternalsPlugin.js +0 -51
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.js +0 -6
- package/dist/builtin-plugin/FileUriPlugin.js +0 -6
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.js +0 -6
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.js +0 -6
- package/dist/builtin-plugin/HotModuleReplacementPlugin.js +0 -18
- package/dist/builtin-plugin/HtmlRspackPlugin.js +0 -285
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.js +0 -11
- package/dist/builtin-plugin/IgnorePlugin.js +0 -20
- package/dist/builtin-plugin/InferAsyncModulesPlugin.js +0 -6
- package/dist/builtin-plugin/JavascriptModulesPlugin.js +0 -55
- package/dist/builtin-plugin/JsLoaderRspackPlugin.js +0 -9
- package/dist/builtin-plugin/JsonModulesPlugin.js +0 -6
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +0 -30
- package/dist/builtin-plugin/LimitChunkCountPlugin.js +0 -8
- package/dist/builtin-plugin/MangleExportsPlugin.js +0 -6
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.js +0 -6
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/ModuleConcatenationPlugin.js +0 -6
- package/dist/builtin-plugin/NamedChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NamedModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.js +0 -6
- package/dist/builtin-plugin/NodeTargetPlugin.js +0 -6
- package/dist/builtin-plugin/ProgressPlugin.js +0 -15
- package/dist/builtin-plugin/ProvidePlugin.js +0 -14
- package/dist/builtin-plugin/RealContentHashPlugin.js +0 -6
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.js +0 -6
- package/dist/builtin-plugin/RuntimeChunkPlugin.js +0 -6
- package/dist/builtin-plugin/RuntimePlugin.js +0 -6
- package/dist/builtin-plugin/SideEffectsFlagPlugin.js +0 -6
- package/dist/builtin-plugin/SizeLimitsPlugin.js +0 -9
- package/dist/builtin-plugin/SourceMapDevToolPlugin.js +0 -14
- package/dist/builtin-plugin/SplitChunksPlugin.js +0 -92
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +0 -80
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.js +0 -6
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.js +0 -6
- package/dist/builtin-plugin/WorkerPlugin.js +0 -31
- package/dist/builtin-plugin/base.js +0 -58
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +0 -182
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +0 -2
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +0 -31
- package/dist/builtin-plugin/css-extract/index.js +0 -105
- package/dist/builtin-plugin/css-extract/loader.js +0 -204
- package/dist/builtin-plugin/css-extract/utils.js +0 -51
- package/dist/builtin-plugin/index.js +0 -84
- package/dist/builtin-plugin/lazy-compilation/backend.js +0 -139
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.js +0 -6
- package/dist/builtin-plugin/lazy-compilation/plugin.js +0 -60
- package/dist/config/adapter.js +0 -691
- package/dist/config/adapterRuleUse.js +0 -107
- package/dist/config/browserslistTargetHandler.js +0 -345
- package/dist/config/defaults.js +0 -876
- package/dist/config/index.js +0 -20
- package/dist/config/normalization.js +0 -299
- package/dist/config/target.js +0 -318
- package/dist/config/types.js +0 -3
- package/dist/config/zod.js +0 -1028
- package/dist/container/ContainerPlugin.js +0 -50
- package/dist/container/ContainerReferencePlugin.js +0 -49
- package/dist/container/ModuleFederationPlugin.js +0 -137
- package/dist/container/ModuleFederationPluginV1.js +0 -63
- package/dist/container/ModuleFederationRuntimePlugin.js +0 -6
- package/dist/container/options.js +0 -48
- package/dist/error/ConcurrentCompilationError.js +0 -20
- package/dist/exports.js +0 -183
- package/dist/lib/AbstractMethodError.js +0 -51
- package/dist/lib/Cache.js +0 -111
- package/dist/lib/CacheFacade.js +0 -321
- package/dist/lib/Dependency.js +0 -11
- package/dist/lib/EntryOptionPlugin.js +0 -89
- package/dist/lib/EnvironmentPlugin.js +0 -57
- package/dist/lib/HookWebpackError.js +0 -83
- package/dist/lib/IgnoreWarningsPlugin.js +0 -35
- package/dist/lib/LoaderOptionsPlugin.js +0 -74
- package/dist/lib/LoaderTargetPlugin.js +0 -37
- package/dist/lib/ModuleFilenameHelpers.js +0 -83
- package/dist/lib/NormalModuleReplacementPlugin.js +0 -85
- package/dist/lib/WebpackError.js +0 -20
- package/dist/lib/cache/MemoryCachePlugin.js +0 -40
- package/dist/lib/cache/getLazyHashedEtag.js +0 -73
- package/dist/lib/cache/mergeEtags.js +0 -74
- package/dist/lib/formatLocation.js +0 -64
- package/dist/loader-runner/LoaderLoadingError.js +0 -19
- package/dist/loader-runner/index.js +0 -735
- package/dist/loader-runner/loadLoader.js +0 -64
- package/dist/logging/Logger.js +0 -143
- package/dist/logging/createConsoleLogger.js +0 -176
- package/dist/logging/runtime.js +0 -37
- package/dist/logging/truncateArgs.js +0 -81
- package/dist/node/NodeEnvironmentPlugin.js +0 -50
- package/dist/node/NodeTemplatePlugin.js +0 -26
- package/dist/node/NodeWatchFileSystem.js +0 -144
- package/dist/node/nodeConsole.js +0 -146
- package/dist/rspack.js +0 -123
- package/dist/rspackOptionsApply.js +0 -274
- package/dist/sharing/ConsumeSharedPlugin.js +0 -69
- package/dist/sharing/ProvideSharedPlugin.js +0 -50
- package/dist/sharing/SharePlugin.js +0 -66
- package/dist/sharing/ShareRuntimePlugin.js +0 -26
- package/dist/sharing/utils.js +0 -8
- package/dist/stats/DefaultStatsFactoryPlugin.js +0 -1173
- package/dist/stats/DefaultStatsPresetPlugin.js +0 -305
- package/dist/stats/DefaultStatsPrinterPlugin.js +0 -1069
- package/dist/stats/StatsFactory.js +0 -167
- package/dist/stats/StatsPrinter.js +0 -142
- package/dist/stats/statsFactoryUtils.js +0 -341
- package/dist/util/ArrayQueue.js +0 -108
- package/dist/util/AssetInfo.js +0 -39
- package/dist/util/IterableHelpers.js +0 -35
- package/dist/util/MergeCaller.js +0 -24
- package/dist/util/SizeFormatHelpers.js +0 -24
- package/dist/util/SplitChunkSize.js +0 -18
- package/dist/util/assertNotNil.js +0 -9
- package/dist/util/assetCondition.js +0 -2
- package/dist/util/bindingVersionCheck.js +0 -124
- package/dist/util/cleverMerge.js +0 -504
- package/dist/util/comparators.js +0 -108
- package/dist/util/createHash.js +0 -161
- package/dist/util/createReadonlyMap.js +0 -29
- package/dist/util/fake.js +0 -28
- package/dist/util/fs.js +0 -120
- package/dist/util/hash/BatchedHash.js +0 -69
- package/dist/util/hash/index.js +0 -39
- package/dist/util/hash/md4.js +0 -27
- package/dist/util/hash/wasm-hash.js +0 -167
- package/dist/util/hash/xxhash64.js +0 -27
- package/dist/util/identifier.js +0 -330
- package/dist/util/index.js +0 -123
- package/dist/util/memoize.js +0 -61
- package/dist/util/scheme.js +0 -57
- package/dist/util/smartGrouping.js +0 -148
- package/dist/util/source.js +0 -42
- package/dist/util/validate.js +0 -77
- package/dist/util/webpack.js +0 -27
- /package/dist/{container/default.runtime.js → moduleFederationDefaultRuntime.js} +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContainerPlugin = void 0;
|
|
4
|
-
const binding_1 = require("@rspack/binding");
|
|
5
|
-
const base_1 = require("../builtin-plugin/base");
|
|
6
|
-
const config_1 = require("../config");
|
|
7
|
-
const options_1 = require("../container/options");
|
|
8
|
-
const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
|
|
9
|
-
class ContainerPlugin extends base_1.RspackBuiltinPlugin {
|
|
10
|
-
constructor(options) {
|
|
11
|
-
super();
|
|
12
|
-
this.name = binding_1.BuiltinPluginName.ContainerPlugin;
|
|
13
|
-
this._options = {
|
|
14
|
-
name: options.name,
|
|
15
|
-
shareScope: options.shareScope || "default",
|
|
16
|
-
library: options.library || {
|
|
17
|
-
type: "var",
|
|
18
|
-
name: options.name
|
|
19
|
-
},
|
|
20
|
-
runtime: options.runtime,
|
|
21
|
-
filename: options.filename,
|
|
22
|
-
exposes: (0, options_1.parseOptions)(options.exposes, item => ({
|
|
23
|
-
import: Array.isArray(item) ? item : [item],
|
|
24
|
-
name: undefined
|
|
25
|
-
}), item => ({
|
|
26
|
-
import: Array.isArray(item.import) ? item.import : [item.import],
|
|
27
|
-
name: item.name || undefined
|
|
28
|
-
})),
|
|
29
|
-
enhanced: options.enhanced ?? false
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
raw(compiler) {
|
|
33
|
-
const { name, shareScope, library, runtime, filename, exposes, enhanced } = this._options;
|
|
34
|
-
if (!compiler.options.output.enabledLibraryTypes.includes(library.type)) {
|
|
35
|
-
compiler.options.output.enabledLibraryTypes.push(library.type);
|
|
36
|
-
}
|
|
37
|
-
new ShareRuntimePlugin_1.ShareRuntimePlugin(this._options.enhanced).apply(compiler);
|
|
38
|
-
const rawOptions = {
|
|
39
|
-
name,
|
|
40
|
-
shareScope,
|
|
41
|
-
library: (0, config_1.getRawLibrary)(library),
|
|
42
|
-
runtime,
|
|
43
|
-
filename,
|
|
44
|
-
exposes: exposes.map(([key, r]) => ({ key, ...r })),
|
|
45
|
-
enhanced
|
|
46
|
-
};
|
|
47
|
-
return (0, base_1.createBuiltinPlugin)(this.name, rawOptions);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.ContainerPlugin = ContainerPlugin;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContainerReferencePlugin = void 0;
|
|
4
|
-
const binding_1 = require("@rspack/binding");
|
|
5
|
-
const ExternalsPlugin_1 = require("../builtin-plugin/ExternalsPlugin");
|
|
6
|
-
const base_1 = require("../builtin-plugin/base");
|
|
7
|
-
const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
|
|
8
|
-
const options_1 = require("./options");
|
|
9
|
-
class ContainerReferencePlugin extends base_1.RspackBuiltinPlugin {
|
|
10
|
-
constructor(options) {
|
|
11
|
-
super();
|
|
12
|
-
this.name = binding_1.BuiltinPluginName.ContainerReferencePlugin;
|
|
13
|
-
this._options = {
|
|
14
|
-
remoteType: options.remoteType,
|
|
15
|
-
remotes: (0, options_1.parseOptions)(options.remotes, item => ({
|
|
16
|
-
external: Array.isArray(item) ? item : [item],
|
|
17
|
-
shareScope: options.shareScope || "default"
|
|
18
|
-
}), item => ({
|
|
19
|
-
external: Array.isArray(item.external)
|
|
20
|
-
? item.external
|
|
21
|
-
: [item.external],
|
|
22
|
-
shareScope: item.shareScope || options.shareScope || "default"
|
|
23
|
-
})),
|
|
24
|
-
enhanced: options.enhanced ?? false
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
raw(compiler) {
|
|
28
|
-
const { remoteType, remotes } = this._options;
|
|
29
|
-
const remoteExternals = {};
|
|
30
|
-
for (const [key, config] of remotes) {
|
|
31
|
-
let i = 0;
|
|
32
|
-
for (const external of config.external) {
|
|
33
|
-
if (external.startsWith("internal "))
|
|
34
|
-
continue;
|
|
35
|
-
remoteExternals[`webpack/container/reference/${key}${i ? `/fallback-${i}` : ""}`] = external;
|
|
36
|
-
i++;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
new ExternalsPlugin_1.ExternalsPlugin(remoteType, remoteExternals).apply(compiler);
|
|
40
|
-
new ShareRuntimePlugin_1.ShareRuntimePlugin(this._options.enhanced).apply(compiler);
|
|
41
|
-
const rawOptions = {
|
|
42
|
-
remoteType: this._options.remoteType,
|
|
43
|
-
remotes: this._options.remotes.map(([key, r]) => ({ key, ...r })),
|
|
44
|
-
enhanced: this._options.enhanced
|
|
45
|
-
};
|
|
46
|
-
return (0, base_1.createBuiltinPlugin)(this.name, rawOptions);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.ContainerReferencePlugin = ContainerReferencePlugin;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModuleFederationPlugin = void 0;
|
|
4
|
-
const config_1 = require("../config");
|
|
5
|
-
const validate_1 = require("../util/validate");
|
|
6
|
-
const ModuleFederationRuntimePlugin_1 = require("./ModuleFederationRuntimePlugin");
|
|
7
|
-
const options_1 = require("./options");
|
|
8
|
-
class ModuleFederationPlugin {
|
|
9
|
-
constructor(_options) {
|
|
10
|
-
this._options = _options;
|
|
11
|
-
}
|
|
12
|
-
apply(compiler) {
|
|
13
|
-
const { webpack } = compiler;
|
|
14
|
-
const paths = getPaths(this._options);
|
|
15
|
-
compiler.options.resolve.alias = {
|
|
16
|
-
"@module-federation/runtime-tools": paths.runtimeTools,
|
|
17
|
-
"@module-federation/runtime": paths.runtime,
|
|
18
|
-
...compiler.options.resolve.alias
|
|
19
|
-
};
|
|
20
|
-
compiler.hooks.afterPlugins.tap(ModuleFederationPlugin.name, () => {
|
|
21
|
-
new webpack.EntryPlugin(compiler.context, getDefaultEntryRuntime(paths, this._options, compiler), { name: undefined }).apply(compiler);
|
|
22
|
-
});
|
|
23
|
-
new ModuleFederationRuntimePlugin_1.ModuleFederationRuntimePlugin().apply(compiler);
|
|
24
|
-
new webpack.container.ModuleFederationPluginV1({
|
|
25
|
-
...this._options,
|
|
26
|
-
enhanced: true
|
|
27
|
-
}).apply(compiler);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.ModuleFederationPlugin = ModuleFederationPlugin;
|
|
31
|
-
function getRemoteInfos(options) {
|
|
32
|
-
if (!options.remotes) {
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
function extractUrlAndGlobal(urlAndGlobal) {
|
|
36
|
-
const index = urlAndGlobal.indexOf("@");
|
|
37
|
-
if (index <= 0 || index === urlAndGlobal.length - 1) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return [
|
|
41
|
-
urlAndGlobal.substring(index + 1),
|
|
42
|
-
urlAndGlobal.substring(0, index)
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
|
-
function getExternalTypeFromExternal(external) {
|
|
46
|
-
if (/^[a-z0-9-]+ /.test(external)) {
|
|
47
|
-
const idx = external.indexOf(" ");
|
|
48
|
-
return [
|
|
49
|
-
external.slice(0, idx),
|
|
50
|
-
external.slice(idx + 1)
|
|
51
|
-
];
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
function getExternal(external) {
|
|
56
|
-
const result = getExternalTypeFromExternal(external);
|
|
57
|
-
if (result === null) {
|
|
58
|
-
return [remoteType, external];
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
const remoteType = options.remoteType ||
|
|
63
|
-
(options.library && (0, validate_1.isValidate)(options.library.type, config_1.externalsType)
|
|
64
|
-
? options.library.type
|
|
65
|
-
: "script");
|
|
66
|
-
const remotes = (0, options_1.parseOptions)(options.remotes, item => ({
|
|
67
|
-
external: Array.isArray(item) ? item : [item],
|
|
68
|
-
shareScope: options.shareScope || "default"
|
|
69
|
-
}), item => ({
|
|
70
|
-
external: Array.isArray(item.external) ? item.external : [item.external],
|
|
71
|
-
shareScope: item.shareScope || options.shareScope || "default"
|
|
72
|
-
}));
|
|
73
|
-
const remoteInfos = {};
|
|
74
|
-
for (const [key, config] of remotes) {
|
|
75
|
-
for (const external of config.external) {
|
|
76
|
-
const [externalType, externalRequest] = getExternal(external);
|
|
77
|
-
remoteInfos[key] ??= [];
|
|
78
|
-
if (externalType === "script") {
|
|
79
|
-
const [url, global] = extractUrlAndGlobal(externalRequest);
|
|
80
|
-
remoteInfos[key].push({
|
|
81
|
-
alias: key,
|
|
82
|
-
name: global,
|
|
83
|
-
entry: url,
|
|
84
|
-
externalType,
|
|
85
|
-
shareScope: config.shareScope
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
remoteInfos[key].push({
|
|
90
|
-
alias: key,
|
|
91
|
-
name: undefined,
|
|
92
|
-
entry: undefined,
|
|
93
|
-
externalType,
|
|
94
|
-
shareScope: config.shareScope
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return remoteInfos;
|
|
100
|
-
}
|
|
101
|
-
function getRuntimePlugins(options) {
|
|
102
|
-
return options.runtimePlugins ?? [];
|
|
103
|
-
}
|
|
104
|
-
function getPaths(options) {
|
|
105
|
-
const runtimeToolsPath = options.implementation ??
|
|
106
|
-
require.resolve("@module-federation/runtime-tools");
|
|
107
|
-
const bundlerRuntimePath = require.resolve("@module-federation/webpack-bundler-runtime", { paths: [runtimeToolsPath] });
|
|
108
|
-
const runtimePath = require.resolve("@module-federation/runtime", {
|
|
109
|
-
paths: [runtimeToolsPath]
|
|
110
|
-
});
|
|
111
|
-
return {
|
|
112
|
-
runtimeTools: runtimeToolsPath,
|
|
113
|
-
bundlerRuntime: bundlerRuntimePath,
|
|
114
|
-
runtime: runtimePath
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function getDefaultEntryRuntime(paths, options, compiler) {
|
|
118
|
-
const runtimePlugins = getRuntimePlugins(options);
|
|
119
|
-
const remoteInfos = getRemoteInfos(options);
|
|
120
|
-
const runtimePluginImports = [];
|
|
121
|
-
const runtimePluginVars = [];
|
|
122
|
-
for (let i = 0; i < runtimePlugins.length; i++) {
|
|
123
|
-
const runtimePluginVar = `__module_federation_runtime_plugin_${i}__`;
|
|
124
|
-
runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(runtimePlugins[i])}`);
|
|
125
|
-
runtimePluginVars.push(`${runtimePluginVar}()`);
|
|
126
|
-
}
|
|
127
|
-
const content = [
|
|
128
|
-
`import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
|
|
129
|
-
...runtimePluginImports,
|
|
130
|
-
`const __module_federation_runtime_plugins__ = [${runtimePluginVars.join(", ")}]`,
|
|
131
|
-
`const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
|
|
132
|
-
`const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
|
|
133
|
-
`const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? "version-first")}`,
|
|
134
|
-
compiler.webpack.Template.getFunctionContent(require("./default.runtime"))
|
|
135
|
-
].join(";");
|
|
136
|
-
return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
|
|
137
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModuleFederationPluginV1 = void 0;
|
|
4
|
-
const config_1 = require("../config");
|
|
5
|
-
const SharePlugin_1 = require("../sharing/SharePlugin");
|
|
6
|
-
const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
|
|
7
|
-
const validate_1 = require("../util/validate");
|
|
8
|
-
const ContainerPlugin_1 = require("./ContainerPlugin");
|
|
9
|
-
const ContainerReferencePlugin_1 = require("./ContainerReferencePlugin");
|
|
10
|
-
class ModuleFederationPluginV1 {
|
|
11
|
-
constructor(_options) {
|
|
12
|
-
this._options = _options;
|
|
13
|
-
}
|
|
14
|
-
apply(compiler) {
|
|
15
|
-
const { _options: options } = this;
|
|
16
|
-
const enhanced = options.enhanced ?? false;
|
|
17
|
-
const library = options.library || { type: "var", name: options.name };
|
|
18
|
-
const remoteType = options.remoteType ||
|
|
19
|
-
(options.library && (0, validate_1.isValidate)(options.library.type, config_1.externalsType)
|
|
20
|
-
? options.library.type
|
|
21
|
-
: "script");
|
|
22
|
-
if (library &&
|
|
23
|
-
!compiler.options.output.enabledLibraryTypes.includes(library.type)) {
|
|
24
|
-
compiler.options.output.enabledLibraryTypes.push(library.type);
|
|
25
|
-
}
|
|
26
|
-
compiler.hooks.afterPlugins.tap("ModuleFederationPlugin", () => {
|
|
27
|
-
new ShareRuntimePlugin_1.ShareRuntimePlugin(this._options.enhanced).apply(compiler);
|
|
28
|
-
if (options.exposes &&
|
|
29
|
-
(Array.isArray(options.exposes)
|
|
30
|
-
? options.exposes.length > 0
|
|
31
|
-
: Object.keys(options.exposes).length > 0)) {
|
|
32
|
-
new ContainerPlugin_1.ContainerPlugin({
|
|
33
|
-
name: options.name,
|
|
34
|
-
library,
|
|
35
|
-
filename: options.filename,
|
|
36
|
-
runtime: options.runtime,
|
|
37
|
-
shareScope: options.shareScope,
|
|
38
|
-
exposes: options.exposes,
|
|
39
|
-
enhanced
|
|
40
|
-
}).apply(compiler);
|
|
41
|
-
}
|
|
42
|
-
if (options.remotes &&
|
|
43
|
-
(Array.isArray(options.remotes)
|
|
44
|
-
? options.remotes.length > 0
|
|
45
|
-
: Object.keys(options.remotes).length > 0)) {
|
|
46
|
-
new ContainerReferencePlugin_1.ContainerReferencePlugin({
|
|
47
|
-
remoteType,
|
|
48
|
-
shareScope: options.shareScope,
|
|
49
|
-
remotes: options.remotes,
|
|
50
|
-
enhanced
|
|
51
|
-
}).apply(compiler);
|
|
52
|
-
}
|
|
53
|
-
if (options.shared) {
|
|
54
|
-
new SharePlugin_1.SharePlugin({
|
|
55
|
-
shared: options.shared,
|
|
56
|
-
shareScope: options.shareScope,
|
|
57
|
-
enhanced
|
|
58
|
-
}).apply(compiler);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.ModuleFederationPluginV1 = ModuleFederationPluginV1;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModuleFederationRuntimePlugin = void 0;
|
|
4
|
-
const binding_1 = require("@rspack/binding");
|
|
5
|
-
const base_1 = require("../builtin-plugin/base");
|
|
6
|
-
exports.ModuleFederationRuntimePlugin = (0, base_1.create)(binding_1.BuiltinPluginName.ModuleFederationRuntimePlugin, () => { });
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseOptions = void 0;
|
|
4
|
-
const process = (options, normalizeSimple, normalizeOptions, fn) => {
|
|
5
|
-
const array = (items) => {
|
|
6
|
-
for (const item of items) {
|
|
7
|
-
if (typeof item === "string") {
|
|
8
|
-
fn(item, normalizeSimple(item, item));
|
|
9
|
-
}
|
|
10
|
-
else if (item && typeof item === "object") {
|
|
11
|
-
object(item);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
throw new Error("Unexpected options format");
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const object = (obj) => {
|
|
19
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
20
|
-
if (typeof value === "string" || Array.isArray(value)) {
|
|
21
|
-
fn(key, normalizeSimple(value, key));
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
fn(key, normalizeOptions(value, key));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
if (!options) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (Array.isArray(options)) {
|
|
32
|
-
array(options);
|
|
33
|
-
}
|
|
34
|
-
else if (typeof options === "object") {
|
|
35
|
-
object(options);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
throw new Error("Unexpected options format");
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const parseOptions = (options, normalizeSimple, normalizeOptions) => {
|
|
42
|
-
const items = [];
|
|
43
|
-
process(options, normalizeSimple, normalizeOptions, (key, value) => {
|
|
44
|
-
items.push([key, value]);
|
|
45
|
-
});
|
|
46
|
-
return items;
|
|
47
|
-
};
|
|
48
|
-
exports.parseOptions = parseOptions;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* The following code is modified based on
|
|
4
|
-
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/ConcurrentCompilationError.js
|
|
5
|
-
*
|
|
6
|
-
* MIT Licensed
|
|
7
|
-
* Author Maksim Nazarjev @acupofspirt
|
|
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
|
-
class ConcurrentCompilationError extends Error {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
this.name = "ConcurrentCompilationError";
|
|
16
|
-
this.message =
|
|
17
|
-
"You ran rspack twice. Each instance only supports a single concurrent compilation at a time.";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = ConcurrentCompilationError;
|
package/dist/exports.js
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
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
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.LightningCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.web = exports.NormalModuleReplacementPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.EnvironmentPlugin = exports.NoEmitOnErrorsPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.DynamicEntryPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.IgnorePlugin = exports.BannerPlugin = exports.EntryOptionPlugin = exports.util = exports.ValidationError = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.RuntimeModule = exports.Stats = exports.RuntimeGlobals = exports.NormalModule = exports.MultiStats = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compiler = exports.Compilation = exports.version = exports.rspackVersion = void 0;
|
|
30
|
-
exports.experiments = exports.ContextReplacementPlugin = exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = void 0;
|
|
31
|
-
const package_json_1 = require("../package.json");
|
|
32
|
-
// this is a hack to be compatible with plugin which detect webpack's version
|
|
33
|
-
const rspackVersion = package_json_1.version;
|
|
34
|
-
exports.rspackVersion = rspackVersion;
|
|
35
|
-
const version = package_json_1.webpackVersion;
|
|
36
|
-
exports.version = version;
|
|
37
|
-
var Compilation_1 = require("./Compilation");
|
|
38
|
-
Object.defineProperty(exports, "Compilation", { enumerable: true, get: function () { return Compilation_1.Compilation; } });
|
|
39
|
-
var Compiler_1 = require("./Compiler");
|
|
40
|
-
Object.defineProperty(exports, "Compiler", { enumerable: true, get: function () { return Compiler_1.Compiler; } });
|
|
41
|
-
var MultiCompiler_1 = require("./MultiCompiler");
|
|
42
|
-
Object.defineProperty(exports, "MultiCompiler", { enumerable: true, get: function () { return MultiCompiler_1.MultiCompiler; } });
|
|
43
|
-
const rspackOptionsApply_1 = require("./rspackOptionsApply");
|
|
44
|
-
Object.defineProperty(exports, "RspackOptionsApply", { enumerable: true, get: function () { return rspackOptionsApply_1.RspackOptionsApply; } });
|
|
45
|
-
Object.defineProperty(exports, "WebpackOptionsApply", { enumerable: true, get: function () { return rspackOptionsApply_1.RspackOptionsApply; } });
|
|
46
|
-
var MultiStats_1 = require("./MultiStats");
|
|
47
|
-
Object.defineProperty(exports, "MultiStats", { enumerable: true, get: function () { return MultiStats_1.MultiStats; } });
|
|
48
|
-
var NormalModule_1 = require("./NormalModule");
|
|
49
|
-
Object.defineProperty(exports, "NormalModule", { enumerable: true, get: function () { return NormalModule_1.NormalModule; } });
|
|
50
|
-
var RuntimeGlobals_1 = require("./RuntimeGlobals");
|
|
51
|
-
Object.defineProperty(exports, "RuntimeGlobals", { enumerable: true, get: function () { return RuntimeGlobals_1.RuntimeGlobals; } });
|
|
52
|
-
var Stats_1 = require("./Stats");
|
|
53
|
-
Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return Stats_1.Stats; } });
|
|
54
|
-
var RuntimeModule_1 = require("./RuntimeModule");
|
|
55
|
-
Object.defineProperty(exports, "RuntimeModule", { enumerable: true, get: function () { return RuntimeModule_1.RuntimeModule; } });
|
|
56
|
-
// API extractor not working with some re-exports, see: https://github.com/microsoft/fluentui/issues/20694
|
|
57
|
-
const ModuleFilenameHelpers = __importStar(require("./lib/ModuleFilenameHelpers"));
|
|
58
|
-
exports.ModuleFilenameHelpers = ModuleFilenameHelpers;
|
|
59
|
-
// API extractor not working with some re-exports, see: https://github.com/microsoft/fluentui/issues/20694
|
|
60
|
-
var Template_1 = require("./Template");
|
|
61
|
-
Object.defineProperty(exports, "Template", { enumerable: true, get: function () { return Template_1.Template; } });
|
|
62
|
-
exports.WebpackError = Error;
|
|
63
|
-
const sources = require("../compiled/webpack-sources");
|
|
64
|
-
exports.sources = sources;
|
|
65
|
-
const config_1 = require("./config");
|
|
66
|
-
exports.config = {
|
|
67
|
-
getNormalizedRspackOptions: config_1.getNormalizedRspackOptions,
|
|
68
|
-
applyRspackOptionsDefaults: config_1.applyRspackOptionsDefaults,
|
|
69
|
-
getNormalizedWebpackOptions: config_1.getNormalizedRspackOptions,
|
|
70
|
-
applyWebpackOptionsDefaults: config_1.applyRspackOptionsDefaults
|
|
71
|
-
};
|
|
72
|
-
const validate_1 = require("./util/validate");
|
|
73
|
-
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validate_1.ValidationError; } });
|
|
74
|
-
const cleverMerge_1 = require("./util/cleverMerge");
|
|
75
|
-
const createHash_1 = require("./util/createHash");
|
|
76
|
-
exports.util = { createHash: createHash_1.createHash, cleverMerge: cleverMerge_1.cachedCleverMerge };
|
|
77
|
-
var EntryOptionPlugin_1 = require("./lib/EntryOptionPlugin");
|
|
78
|
-
Object.defineProperty(exports, "EntryOptionPlugin", { enumerable: true, get: function () { return __importDefault(EntryOptionPlugin_1).default; } });
|
|
79
|
-
var builtin_plugin_1 = require("./builtin-plugin");
|
|
80
|
-
Object.defineProperty(exports, "BannerPlugin", { enumerable: true, get: function () { return builtin_plugin_1.BannerPlugin; } });
|
|
81
|
-
var builtin_plugin_2 = require("./builtin-plugin");
|
|
82
|
-
Object.defineProperty(exports, "IgnorePlugin", { enumerable: true, get: function () { return builtin_plugin_2.IgnorePlugin; } });
|
|
83
|
-
var builtin_plugin_3 = require("./builtin-plugin");
|
|
84
|
-
Object.defineProperty(exports, "ProvidePlugin", { enumerable: true, get: function () { return builtin_plugin_3.ProvidePlugin; } });
|
|
85
|
-
var builtin_plugin_4 = require("./builtin-plugin");
|
|
86
|
-
Object.defineProperty(exports, "DefinePlugin", { enumerable: true, get: function () { return builtin_plugin_4.DefinePlugin; } });
|
|
87
|
-
var builtin_plugin_5 = require("./builtin-plugin");
|
|
88
|
-
Object.defineProperty(exports, "ProgressPlugin", { enumerable: true, get: function () { return builtin_plugin_5.ProgressPlugin; } });
|
|
89
|
-
var builtin_plugin_6 = require("./builtin-plugin");
|
|
90
|
-
Object.defineProperty(exports, "EntryPlugin", { enumerable: true, get: function () { return builtin_plugin_6.EntryPlugin; } });
|
|
91
|
-
var builtin_plugin_7 = require("./builtin-plugin");
|
|
92
|
-
Object.defineProperty(exports, "DynamicEntryPlugin", { enumerable: true, get: function () { return builtin_plugin_7.DynamicEntryPlugin; } });
|
|
93
|
-
var builtin_plugin_8 = require("./builtin-plugin");
|
|
94
|
-
Object.defineProperty(exports, "ExternalsPlugin", { enumerable: true, get: function () { return builtin_plugin_8.ExternalsPlugin; } });
|
|
95
|
-
var builtin_plugin_9 = require("./builtin-plugin");
|
|
96
|
-
Object.defineProperty(exports, "HotModuleReplacementPlugin", { enumerable: true, get: function () { return builtin_plugin_9.HotModuleReplacementPlugin; } });
|
|
97
|
-
var builtin_plugin_10 = require("./builtin-plugin");
|
|
98
|
-
Object.defineProperty(exports, "NoEmitOnErrorsPlugin", { enumerable: true, get: function () { return builtin_plugin_10.NoEmitOnErrorsPlugin; } });
|
|
99
|
-
var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
|
|
100
|
-
Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
|
|
101
|
-
var LoaderOptionsPlugin_1 = require("./lib/LoaderOptionsPlugin");
|
|
102
|
-
Object.defineProperty(exports, "LoaderOptionsPlugin", { enumerable: true, get: function () { return LoaderOptionsPlugin_1.LoaderOptionsPlugin; } });
|
|
103
|
-
var LoaderTargetPlugin_1 = require("./lib/LoaderTargetPlugin");
|
|
104
|
-
Object.defineProperty(exports, "LoaderTargetPlugin", { enumerable: true, get: function () { return LoaderTargetPlugin_1.LoaderTargetPlugin; } });
|
|
105
|
-
var NormalModuleReplacementPlugin_1 = require("./lib/NormalModuleReplacementPlugin");
|
|
106
|
-
Object.defineProperty(exports, "NormalModuleReplacementPlugin", { enumerable: true, get: function () { return NormalModuleReplacementPlugin_1.NormalModuleReplacementPlugin; } });
|
|
107
|
-
const builtin_plugin_11 = require("./builtin-plugin");
|
|
108
|
-
exports.web = {
|
|
109
|
-
FetchCompileAsyncWasmPlugin: builtin_plugin_11.FetchCompileAsyncWasmPlugin
|
|
110
|
-
};
|
|
111
|
-
const builtin_plugin_12 = require("./builtin-plugin");
|
|
112
|
-
const NodeEnvironmentPlugin_1 = __importDefault(require("./node/NodeEnvironmentPlugin"));
|
|
113
|
-
const NodeTemplatePlugin_1 = __importDefault(require("./node/NodeTemplatePlugin"));
|
|
114
|
-
exports.node = {
|
|
115
|
-
NodeTargetPlugin: builtin_plugin_12.NodeTargetPlugin,
|
|
116
|
-
NodeTemplatePlugin: NodeTemplatePlugin_1.default,
|
|
117
|
-
NodeEnvironmentPlugin: NodeEnvironmentPlugin_1.default
|
|
118
|
-
};
|
|
119
|
-
const builtin_plugin_13 = require("./builtin-plugin");
|
|
120
|
-
exports.electron = { ElectronTargetPlugin: builtin_plugin_13.ElectronTargetPlugin };
|
|
121
|
-
const builtin_plugin_14 = require("./builtin-plugin");
|
|
122
|
-
exports.library = { EnableLibraryPlugin: builtin_plugin_14.EnableLibraryPlugin };
|
|
123
|
-
const builtin_plugin_15 = require("./builtin-plugin");
|
|
124
|
-
exports.wasm = { EnableWasmLoadingPlugin: builtin_plugin_15.EnableWasmLoadingPlugin };
|
|
125
|
-
const builtin_plugin_16 = require("./builtin-plugin");
|
|
126
|
-
exports.javascript = {
|
|
127
|
-
EnableChunkLoadingPlugin: builtin_plugin_16.EnableChunkLoadingPlugin,
|
|
128
|
-
JavascriptModulesPlugin: builtin_plugin_16.JavascriptModulesPlugin
|
|
129
|
-
};
|
|
130
|
-
const builtin_plugin_17 = require("./builtin-plugin");
|
|
131
|
-
exports.webworker = { WebWorkerTemplatePlugin: builtin_plugin_17.WebWorkerTemplatePlugin };
|
|
132
|
-
const builtin_plugin_18 = require("./builtin-plugin");
|
|
133
|
-
const builtin_plugin_19 = require("./builtin-plugin");
|
|
134
|
-
const builtin_plugin_20 = require("./builtin-plugin");
|
|
135
|
-
exports.optimize = {
|
|
136
|
-
LimitChunkCountPlugin: builtin_plugin_18.LimitChunkCountPlugin,
|
|
137
|
-
RuntimeChunkPlugin: builtin_plugin_19.RuntimeChunkPlugin,
|
|
138
|
-
SplitChunksPlugin: builtin_plugin_20.SplitChunksPlugin
|
|
139
|
-
};
|
|
140
|
-
const ModuleFederationPlugin_1 = require("./container/ModuleFederationPlugin");
|
|
141
|
-
const ModuleFederationPluginV1_1 = require("./container/ModuleFederationPluginV1");
|
|
142
|
-
const ContainerPlugin_1 = require("./container/ContainerPlugin");
|
|
143
|
-
const ContainerReferencePlugin_1 = require("./container/ContainerReferencePlugin");
|
|
144
|
-
exports.container = {
|
|
145
|
-
ContainerPlugin: ContainerPlugin_1.ContainerPlugin,
|
|
146
|
-
ContainerReferencePlugin: ContainerReferencePlugin_1.ContainerReferencePlugin,
|
|
147
|
-
ModuleFederationPlugin: ModuleFederationPlugin_1.ModuleFederationPlugin,
|
|
148
|
-
ModuleFederationPluginV1: ModuleFederationPluginV1_1.ModuleFederationPluginV1
|
|
149
|
-
};
|
|
150
|
-
const ConsumeSharedPlugin_1 = require("./sharing/ConsumeSharedPlugin");
|
|
151
|
-
const ProvideSharedPlugin_1 = require("./sharing/ProvideSharedPlugin");
|
|
152
|
-
const SharePlugin_1 = require("./sharing/SharePlugin");
|
|
153
|
-
exports.sharing = {
|
|
154
|
-
ProvideSharedPlugin: ProvideSharedPlugin_1.ProvideSharedPlugin,
|
|
155
|
-
ConsumeSharedPlugin: ConsumeSharedPlugin_1.ConsumeSharedPlugin,
|
|
156
|
-
SharePlugin: SharePlugin_1.SharePlugin
|
|
157
|
-
};
|
|
158
|
-
var builtin_plugin_21 = require("./builtin-plugin");
|
|
159
|
-
Object.defineProperty(exports, "HtmlRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_21.HtmlRspackPlugin; } });
|
|
160
|
-
var builtin_plugin_22 = require("./builtin-plugin");
|
|
161
|
-
Object.defineProperty(exports, "SwcJsMinimizerRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_22.SwcJsMinimizerRspackPlugin; } });
|
|
162
|
-
var builtin_plugin_23 = require("./builtin-plugin");
|
|
163
|
-
Object.defineProperty(exports, "LightningCssMinimizerRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_23.LightningCssMinimizerRspackPlugin; } });
|
|
164
|
-
var builtin_plugin_24 = require("./builtin-plugin");
|
|
165
|
-
Object.defineProperty(exports, "CopyRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_24.CopyRspackPlugin; } });
|
|
166
|
-
var builtin_plugin_25 = require("./builtin-plugin");
|
|
167
|
-
Object.defineProperty(exports, "SourceMapDevToolPlugin", { enumerable: true, get: function () { return builtin_plugin_25.SourceMapDevToolPlugin; } });
|
|
168
|
-
var builtin_plugin_26 = require("./builtin-plugin");
|
|
169
|
-
Object.defineProperty(exports, "EvalSourceMapDevToolPlugin", { enumerable: true, get: function () { return builtin_plugin_26.EvalSourceMapDevToolPlugin; } });
|
|
170
|
-
var builtin_plugin_27 = require("./builtin-plugin");
|
|
171
|
-
Object.defineProperty(exports, "EvalDevToolModulePlugin", { enumerable: true, get: function () { return builtin_plugin_27.EvalDevToolModulePlugin; } });
|
|
172
|
-
var builtin_plugin_28 = require("./builtin-plugin");
|
|
173
|
-
Object.defineProperty(exports, "CssExtractRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_28.CssExtractRspackPlugin; } });
|
|
174
|
-
var builtin_plugin_29 = require("./builtin-plugin");
|
|
175
|
-
Object.defineProperty(exports, "ContextReplacementPlugin", { enumerable: true, get: function () { return builtin_plugin_29.ContextReplacementPlugin; } });
|
|
176
|
-
///// Experiments Stuff /////
|
|
177
|
-
const binding_1 = require("@rspack/binding");
|
|
178
|
-
exports.experiments = {
|
|
179
|
-
globalTrace: {
|
|
180
|
-
register: binding_1.registerGlobalTrace,
|
|
181
|
-
cleanup: binding_1.cleanupGlobalTrace
|
|
182
|
-
}
|
|
183
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* The following code is modified based on
|
|
4
|
-
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/AbstractMethodError.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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.AbstractMethodError = void 0;
|
|
16
|
-
const WebpackError_1 = __importDefault(require("./WebpackError"));
|
|
17
|
-
const CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
|
|
18
|
-
/**
|
|
19
|
-
* @param method method name
|
|
20
|
-
* @returns message
|
|
21
|
-
*/
|
|
22
|
-
function createMessage(method) {
|
|
23
|
-
return `Abstract method${method ? ` ${method}` : ""}. Must be overridden.`;
|
|
24
|
-
}
|
|
25
|
-
class Message extends Error {
|
|
26
|
-
constructor() {
|
|
27
|
-
super();
|
|
28
|
-
this.stack = undefined;
|
|
29
|
-
Error.captureStackTrace(this);
|
|
30
|
-
const match = this.stack.split("\n")[3].match(CURRENT_METHOD_REGEXP);
|
|
31
|
-
this.message = match?.[1] ? createMessage(match[1]) : createMessage();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Error for abstract method
|
|
36
|
-
* @example
|
|
37
|
-
* class FooClass {
|
|
38
|
-
* abstractMethod() {
|
|
39
|
-
* throw new AbstractMethodError(); // error message: Abstract method FooClass.abstractMethod. Must be overridden.
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
class AbstractMethodError extends WebpackError_1.default {
|
|
45
|
-
constructor() {
|
|
46
|
-
super(new Message().message);
|
|
47
|
-
this.name = "AbstractMethodError";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.AbstractMethodError = AbstractMethodError;
|
|
51
|
-
exports.default = AbstractMethodError;
|