@rspack/core 1.0.0-beta.0 → 1.0.0-beta.2
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/ChunkGroup.d.ts +1 -0
- package/dist/ChunkGroup.js +3 -0
- package/dist/Compilation.d.ts +19 -1
- package/dist/Compiler.d.ts +11 -10
- package/dist/Compiler.js +16 -16
- package/dist/ExecuteModulePlugin.d.ts +0 -1
- package/dist/ExecuteModulePlugin.js +0 -1
- package/dist/Module.d.ts +2 -2
- package/dist/Module.js +1 -1
- package/dist/MultiCompiler.js +1 -1
- package/dist/NormalModule.d.ts +1 -0
- package/dist/NormalModule.js +1 -0
- package/dist/Resolver.d.ts +1 -2
- package/dist/RspackError.js +1 -1
- package/dist/Stats.js +22 -2
- package/dist/Template.js +2 -2
- package/dist/builtin-loader/lightningcss/index.js +1 -1
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +31 -31
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.js +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.js +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.js +1 -6
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.js +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +3 -2
- package/dist/builtin-plugin/EntryPlugin.js +1 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +5 -5
- package/dist/builtin-plugin/ExternalsPlugin.js +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +9 -9
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +0 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.js +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +4 -11
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +2 -3
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +3 -5
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +7 -5
- package/dist/builtin-plugin/css-extract/loader.d.ts +8 -3
- package/dist/builtin-plugin/css-extract/loader.js +27 -22
- package/dist/builtin-plugin/lazy-compilation/backend.js +4 -4
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/adapter.js +16 -2
- package/dist/config/adapterRuleUse.d.ts +2 -6
- package/dist/config/adapterRuleUse.js +10 -9
- package/dist/config/defaults.js +28 -42
- package/dist/config/normalization.d.ts +7 -3
- package/dist/config/normalization.js +7 -2
- package/dist/config/zod.d.ts +1634 -1093
- package/dist/config/zod.js +31 -2
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/container/default.runtime.js +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/lib/AbstractMethodError.d.ts +12 -3
- package/dist/lib/AbstractMethodError.js +29 -22
- package/dist/lib/Cache.d.ts +40 -46
- package/dist/lib/Cache.js +43 -78
- package/dist/lib/CacheFacade.d.ts +119 -143
- package/dist/lib/CacheFacade.js +123 -124
- package/dist/lib/Dependency.d.ts +23 -0
- package/dist/lib/Dependency.js +11 -0
- package/dist/lib/EntryOptionPlugin.d.ts +19 -2
- package/dist/lib/EntryOptionPlugin.js +22 -6
- package/dist/lib/EnvironmentPlugin.d.ts +17 -10
- package/dist/lib/EnvironmentPlugin.js +16 -17
- package/dist/lib/HookWebpackError.d.ts +27 -33
- package/dist/lib/HookWebpackError.js +33 -34
- package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
- package/dist/lib/{ignoreWarningsPlugin.js → IgnoreWarningsPlugin.js} +17 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts +18 -9
- package/dist/lib/LoaderOptionsPlugin.js +38 -14
- package/dist/lib/LoaderTargetPlugin.d.ts +17 -8
- package/dist/lib/LoaderTargetPlugin.js +17 -15
- package/dist/lib/ModuleFilenameHelpers.d.ts +10 -1
- package/dist/lib/ModuleFilenameHelpers.js +10 -1
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +15 -5
- package/dist/lib/NormalModuleReplacementPlugin.js +15 -5
- package/dist/lib/WebpackError.d.ts +23 -22
- package/dist/lib/WebpackError.js +15 -35
- package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
- package/dist/lib/cache/MemoryCachePlugin.js +40 -0
- package/dist/lib/cache/getLazyHashedEtag.d.ts +24 -24
- package/dist/lib/cache/getLazyHashedEtag.js +20 -23
- package/dist/lib/cache/mergeEtags.d.ts +15 -9
- package/dist/lib/cache/mergeEtags.js +18 -11
- package/dist/lib/formatLocation.d.ts +14 -9
- package/dist/lib/formatLocation.js +17 -15
- package/dist/loader-runner/index.js +6 -7
- package/dist/loader-runner/loadLoader.js +8 -11
- package/dist/logging/Logger.js +3 -3
- package/dist/logging/createConsoleLogger.d.ts +26 -6
- package/dist/logging/createConsoleLogger.js +21 -58
- package/dist/logging/runtime.d.ts +4 -10
- package/dist/logging/runtime.js +8 -23
- package/dist/logging/truncateArgs.d.ts +4 -4
- package/dist/logging/truncateArgs.js +5 -10
- package/dist/node/NodeEnvironmentPlugin.js +2 -2
- package/dist/node/NodeWatchFileSystem.js +6 -6
- package/dist/node/nodeConsole.d.ts +7 -21
- package/dist/node/nodeConsole.js +29 -36
- package/dist/rspackOptionsApply.d.ts +0 -1
- package/dist/rspackOptionsApply.js +10 -9
- package/dist/sharing/ProvideSharedPlugin.d.ts +20 -19
- package/dist/sharing/ProvideSharedPlugin.js +26 -17
- package/dist/sharing/SharePlugin.d.ts +3 -0
- package/dist/sharing/SharePlugin.js +4 -1
- package/dist/stats/DefaultStatsFactoryPlugin.js +187 -96
- package/dist/stats/DefaultStatsPresetPlugin.js +1 -2
- package/dist/stats/DefaultStatsPrinterPlugin.js +18 -19
- package/dist/stats/StatsFactory.d.ts +2 -1
- package/dist/stats/StatsFactory.js +2 -6
- package/dist/stats/statsFactoryUtils.d.ts +63 -23
- package/dist/util/SizeFormatHelpers.js +1 -1
- package/dist/util/bindingVersionCheck.js +3 -3
- package/dist/util/cleverMerge.js +3 -2
- package/dist/util/comparators.d.ts +2 -2
- package/dist/util/comparators.js +5 -4
- package/dist/util/createHash.js +1 -1
- package/dist/util/fs.js +2 -2
- package/dist/util/identifier.js +2 -2
- package/dist/util/index.js +1 -1
- package/dist/util/memoize.js +1 -4
- package/dist/util/smartGrouping.js +4 -6
- package/dist/util/webpack.d.ts +1 -1
- package/dist/util/webpack.js +2 -1
- package/module.d.ts +1 -1
- package/package.json +3 -3
- package/compiled/enhanced-resolve/index.js +0 -5566
- package/dist/lib/ignoreWarningsPlugin.d.ts +0 -7
|
@@ -3,7 +3,7 @@ export declare const MergeDuplicateChunksPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const ModuleChunkFormatPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const ModuleConcatenationPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const NamedChunkIdsPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const NamedModuleIdsPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const NaturalChunkIdsPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const NaturalModuleIdsPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const NodeTargetPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -4,7 +4,7 @@ export declare const ProgressPlugin: {
|
|
|
4
4
|
new (progress?: ProgressPluginArgument): {
|
|
5
5
|
name: BuiltinPluginName;
|
|
6
6
|
_args: [progress?: ProgressPluginArgument];
|
|
7
|
-
affectedHooks: "done" | "
|
|
7
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
8
8
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
10
10
|
};
|
|
@@ -4,7 +4,7 @@ export declare const ProvidePlugin: {
|
|
|
4
4
|
new (provide: ProvidePluginOptions): {
|
|
5
5
|
name: BuiltinPluginName;
|
|
6
6
|
_args: [provide: ProvidePluginOptions];
|
|
7
|
-
affectedHooks: "done" | "
|
|
7
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
8
8
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
10
10
|
};
|
|
@@ -3,7 +3,7 @@ export declare const RealContentHashPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const RemoveEmptyChunksPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -4,7 +4,7 @@ export declare const RuntimeChunkPlugin: {
|
|
|
4
4
|
new (options: RawRuntimeChunkOptions): {
|
|
5
5
|
name: BuiltinPluginName;
|
|
6
6
|
_args: [options: RawRuntimeChunkOptions];
|
|
7
|
-
affectedHooks: "done" | "
|
|
7
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
8
8
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
10
10
|
};
|
|
@@ -3,7 +3,7 @@ export declare const RuntimePlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const SideEffectsFlagPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -13,7 +13,7 @@ export declare const SizeLimitsPlugin: {
|
|
|
13
13
|
maxAssetSize?: number | undefined;
|
|
14
14
|
maxEntrypointSize?: number | undefined;
|
|
15
15
|
}];
|
|
16
|
-
affectedHooks: "done" | "
|
|
16
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
17
17
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
18
18
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
19
19
|
};
|
|
@@ -16,7 +16,7 @@ export declare const SourceMapDevToolPlugin: {
|
|
|
16
16
|
new (options: SourceMapDevToolPluginOptions): {
|
|
17
17
|
name: BuiltinPluginName;
|
|
18
18
|
_args: [options: SourceMapDevToolPluginOptions];
|
|
19
|
-
affectedHooks: "done" | "
|
|
19
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
20
20
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
21
21
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
22
22
|
};
|
|
@@ -10,7 +10,7 @@ export declare const SwcCssMinimizerRspackPlugin: {
|
|
|
10
10
|
new (options?: SwcCssMinimizerRspackPluginOptions | undefined): {
|
|
11
11
|
name: BuiltinPluginName;
|
|
12
12
|
_args: [options?: SwcCssMinimizerRspackPluginOptions | undefined];
|
|
13
|
-
affectedHooks: "done" | "
|
|
13
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
14
14
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
15
15
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
16
16
|
};
|
|
@@ -198,13 +198,12 @@ export interface TerserMangleOptions {
|
|
|
198
198
|
safari10?: boolean;
|
|
199
199
|
reserved?: string[];
|
|
200
200
|
}
|
|
201
|
-
export
|
|
202
|
-
}
|
|
201
|
+
export type TerserManglePropertiesOptions = {};
|
|
203
202
|
export declare const SwcJsMinimizerRspackPlugin: {
|
|
204
203
|
new (options?: SwcJsMinimizerRspackPluginOptions | undefined): {
|
|
205
204
|
name: BuiltinPluginName;
|
|
206
205
|
_args: [options?: SwcJsMinimizerRspackPluginOptions | undefined];
|
|
207
|
-
affectedHooks: "done" | "
|
|
206
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
208
207
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
209
208
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
210
209
|
};
|
|
@@ -3,7 +3,7 @@ export declare const WarnCaseSensitiveModulesPlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ export declare const WebWorkerTemplatePlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_args: [];
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
@@ -14,7 +14,7 @@ export declare function create<T extends any[], R>(name: binding.BuiltinPluginNa
|
|
|
14
14
|
new (...args: T): {
|
|
15
15
|
name: binding.BuiltinPluginName;
|
|
16
16
|
_args: T;
|
|
17
|
-
affectedHooks: "done" | "
|
|
17
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
18
18
|
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
19
19
|
apply(compiler: Compiler): void;
|
|
20
20
|
};
|
|
@@ -7,10 +7,8 @@ const noDocument = typeof document === "undefined";
|
|
|
7
7
|
const { forEach } = Array.prototype;
|
|
8
8
|
function debounce(fn, time) {
|
|
9
9
|
let timeout = 0;
|
|
10
|
-
return function () {
|
|
11
|
-
// @ts-ignore
|
|
10
|
+
return function (...args) {
|
|
12
11
|
const self = this;
|
|
13
|
-
const args = arguments;
|
|
14
12
|
const functionCall = function functionCall() {
|
|
15
13
|
return fn.apply(self, args);
|
|
16
14
|
};
|
|
@@ -34,12 +32,12 @@ function getCurrentScriptUrl(moduleId) {
|
|
|
34
32
|
}
|
|
35
33
|
srcByModuleId[moduleId] = src;
|
|
36
34
|
}
|
|
37
|
-
return
|
|
35
|
+
return (fileMap) => {
|
|
38
36
|
if (!src) {
|
|
39
37
|
return null;
|
|
40
38
|
}
|
|
41
39
|
const splitResult = src.split(/([^\\/]+)\.js$/);
|
|
42
|
-
const filename = splitResult
|
|
40
|
+
const filename = splitResult?.[1];
|
|
43
41
|
if (!filename) {
|
|
44
42
|
return [src.replace(".js", ".css")];
|
|
45
43
|
}
|
|
@@ -6,12 +6,14 @@ function normalizeUrl(urlString) {
|
|
|
6
6
|
if (/^data:/i.test(urlString)) {
|
|
7
7
|
return urlString;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const protocol = urlString.indexOf("//") !== -1 ? `${urlString.split("//")[0]}//` : "";
|
|
10
|
+
const components = urlString
|
|
11
|
+
.replace(new RegExp(protocol, "i"), "")
|
|
12
|
+
.split("/");
|
|
13
|
+
const host = components[0].toLowerCase().replace(/\.$/, "");
|
|
12
14
|
components[0] = "";
|
|
13
|
-
|
|
14
|
-
.reduce(
|
|
15
|
+
const path = components
|
|
16
|
+
.reduce((accumulator, item) => {
|
|
15
17
|
switch (item) {
|
|
16
18
|
case "..":
|
|
17
19
|
accumulator.pop();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { LoaderDefinition } from "../..";
|
|
1
|
+
import type { LoaderContext, LoaderDefinition } from "../..";
|
|
2
|
+
export declare const BASE_URI = "webpack://";
|
|
2
3
|
export declare const MODULE_TYPE = "css/mini-extract";
|
|
3
4
|
export declare const AUTO_PUBLIC_PATH = "__mini_css_extract_plugin_public_path_auto__";
|
|
4
|
-
export declare const ABSOLUTE_PUBLIC_PATH
|
|
5
|
-
export declare const BASE_URI = "webpack://";
|
|
5
|
+
export declare const ABSOLUTE_PUBLIC_PATH: string;
|
|
6
6
|
export declare const SINGLE_DOT_PATH_SEGMENT = "__mini_css_extract_plugin_single_dot_path_segment__";
|
|
7
7
|
export interface CssExtractRspackLoaderOptions {
|
|
8
8
|
publicPath?: string | ((resourcePath: string, context: string) => string);
|
|
@@ -11,6 +11,11 @@ export interface CssExtractRspackLoaderOptions {
|
|
|
11
11
|
layer?: boolean;
|
|
12
12
|
defaultExport?: boolean;
|
|
13
13
|
}
|
|
14
|
+
export declare function hotLoader(content: string, context: {
|
|
15
|
+
loaderContext: LoaderContext;
|
|
16
|
+
options?: CssExtractRspackLoaderOptions;
|
|
17
|
+
locals?: Record<string, string>;
|
|
18
|
+
}): string;
|
|
14
19
|
declare const loader: LoaderDefinition;
|
|
15
20
|
export declare const pitch: LoaderDefinition["pitch"];
|
|
16
21
|
export default loader;
|
|
@@ -3,38 +3,46 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.pitch = exports.
|
|
6
|
+
exports.pitch = exports.hotLoader = exports.SINGLE_DOT_PATH_SEGMENT = exports.ABSOLUTE_PUBLIC_PATH = exports.AUTO_PUBLIC_PATH = exports.MODULE_TYPE = exports.BASE_URI = void 0;
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
8
|
const index_1 = require("./index");
|
|
9
9
|
const loader_options_json_1 = __importDefault(require("./loader-options.json"));
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
|
+
exports.BASE_URI = "webpack://";
|
|
11
12
|
exports.MODULE_TYPE = "css/mini-extract";
|
|
12
13
|
exports.AUTO_PUBLIC_PATH = "__mini_css_extract_plugin_public_path_auto__";
|
|
13
|
-
exports.ABSOLUTE_PUBLIC_PATH =
|
|
14
|
-
exports.BASE_URI = "webpack://";
|
|
14
|
+
exports.ABSOLUTE_PUBLIC_PATH = `${exports.BASE_URI}/mini-css-extract-plugin/`;
|
|
15
15
|
exports.SINGLE_DOT_PATH_SEGMENT = "__mini_css_extract_plugin_single_dot_path_segment__";
|
|
16
16
|
const SERIALIZE_SEP = "__RSPACK_CSS_EXTRACT_SEP__";
|
|
17
17
|
function hotLoader(content, context) {
|
|
18
|
-
const
|
|
19
|
-
? ""
|
|
20
|
-
: "module.hot.accept(undefined, cssReload);";
|
|
18
|
+
const localsJsonString = JSON.stringify(JSON.stringify(context.locals));
|
|
21
19
|
return `${content}
|
|
22
20
|
if(module.hot) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
(function() {
|
|
22
|
+
var localsJsonString = ${localsJsonString};
|
|
23
|
+
// ${Date.now()}
|
|
24
|
+
var cssReload = require(${(0, utils_1.stringifyRequest)(context.loaderContext, node_path_1.default.join(__dirname, "hmr/hotModuleReplacement.js"))}).cssReload(module.id, ${JSON.stringify(context.options ?? {})});
|
|
25
|
+
// only invalidate when locals change
|
|
26
|
+
if (
|
|
27
|
+
module.hot.data &&
|
|
28
|
+
module.hot.data.value &&
|
|
29
|
+
module.hot.data.value !== localsJsonString
|
|
30
|
+
) {
|
|
31
|
+
module.hot.invalidate();
|
|
32
|
+
} else {
|
|
33
|
+
module.hot.accept();
|
|
34
|
+
}
|
|
35
|
+
module.hot.dispose(function(data) {
|
|
36
|
+
data.value = localsJsonString;
|
|
37
|
+
cssReload();
|
|
38
|
+
});
|
|
39
|
+
})();
|
|
30
40
|
}
|
|
31
41
|
`;
|
|
32
42
|
}
|
|
43
|
+
exports.hotLoader = hotLoader;
|
|
33
44
|
const loader = function loader(content) {
|
|
34
|
-
if (this._compiler &&
|
|
35
|
-
this._compiler.options &&
|
|
36
|
-
this._compiler.options.experiments &&
|
|
37
|
-
this._compiler.options.experiments.css &&
|
|
45
|
+
if (this._compiler?.options?.experiments?.css &&
|
|
38
46
|
this._module &&
|
|
39
47
|
(this._module.type === "css" ||
|
|
40
48
|
this._module.type === "css/auto" ||
|
|
@@ -44,10 +52,7 @@ const loader = function loader(content) {
|
|
|
44
52
|
}
|
|
45
53
|
};
|
|
46
54
|
const pitch = function (request, _, data) {
|
|
47
|
-
if (this._compiler &&
|
|
48
|
-
this._compiler.options &&
|
|
49
|
-
this._compiler.options.experiments &&
|
|
50
|
-
this._compiler.options.experiments.css &&
|
|
55
|
+
if (this._compiler?.options?.experiments?.css &&
|
|
51
56
|
this._module &&
|
|
52
57
|
(this._module.type === "css" ||
|
|
53
58
|
this._module.type === "css/auto" ||
|
|
@@ -111,7 +116,7 @@ const pitch = function (request, _, data) {
|
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
else {
|
|
114
|
-
locals = exports
|
|
119
|
+
locals = exports?.locals;
|
|
115
120
|
}
|
|
116
121
|
if (Array.isArray(exports) && emit) {
|
|
117
122
|
const identifierCountMap = new Map();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
-
Author Tobias Koppers @sokra
|
|
4
|
-
*/
|
|
5
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* MIT License http://www.opensource.org/licenses/mit-license.php
|
|
4
|
+
* Author Tobias Koppers @sokra
|
|
5
|
+
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.moduleImpl = exports.dispose = void 0;
|
|
8
8
|
const getBackend = (options) => (compiler, callback) => {
|
|
@@ -17,7 +17,7 @@ export declare const BuiltinLazyCompilationPlugin: {
|
|
|
17
17
|
data: string;
|
|
18
18
|
client: string;
|
|
19
19
|
}, cacheable: boolean, entries: boolean, imports: boolean, test?: RawRegex | ((m: JsModule) => boolean) | undefined];
|
|
20
|
-
affectedHooks: "done" | "
|
|
20
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
21
21
|
raw(compiler: import("../../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
22
22
|
apply(compiler: import("../../Compiler").Compiler): void;
|
|
23
23
|
};
|
package/dist/config/adapter.js
CHANGED
|
@@ -129,6 +129,7 @@ function getRawOutput(output) {
|
|
|
129
129
|
crossOriginLoading: getRawCrossOriginLoading(output.crossOriginLoading),
|
|
130
130
|
cssFilename: output.cssFilename,
|
|
131
131
|
cssChunkFilename: output.cssChunkFilename,
|
|
132
|
+
cssHeadDataCompression: output.cssHeadDataCompression,
|
|
132
133
|
hotUpdateChunkFilename: output.hotUpdateChunkFilename,
|
|
133
134
|
hotUpdateMainFilename: output.hotUpdateMainFilename,
|
|
134
135
|
hotUpdateGlobal: output.hotUpdateGlobal,
|
|
@@ -139,6 +140,7 @@ function getRawOutput(output) {
|
|
|
139
140
|
strictModuleErrorHandling: output.strictModuleErrorHandling,
|
|
140
141
|
globalObject: output.globalObject,
|
|
141
142
|
importFunctionName: output.importFunctionName,
|
|
143
|
+
importMetaName: output.importMetaName,
|
|
142
144
|
iife: output.iife,
|
|
143
145
|
module: output.module,
|
|
144
146
|
wasmLoading: wasmLoading === false ? "false" : wasmLoading,
|
|
@@ -278,6 +280,9 @@ const getRawModuleRule = (rule, path, options, upperType) => {
|
|
|
278
280
|
include: rule.include ? getRawRuleSetCondition(rule.include) : undefined,
|
|
279
281
|
exclude: rule.exclude ? getRawRuleSetCondition(rule.exclude) : undefined,
|
|
280
282
|
issuer: rule.issuer ? getRawRuleSetCondition(rule.issuer) : undefined,
|
|
283
|
+
issuerLayer: rule.issuerLayer
|
|
284
|
+
? getRawRuleSetCondition(rule.issuerLayer)
|
|
285
|
+
: undefined,
|
|
281
286
|
dependency: rule.dependency
|
|
282
287
|
? getRawRuleSetCondition(rule.dependency)
|
|
283
288
|
: undefined,
|
|
@@ -287,6 +292,12 @@ const getRawModuleRule = (rule, path, options, upperType) => {
|
|
|
287
292
|
getRawRuleSetCondition(v)
|
|
288
293
|
]))
|
|
289
294
|
: undefined,
|
|
295
|
+
with: rule.with
|
|
296
|
+
? Object.fromEntries(Object.entries(rule.with).map(([k, v]) => [
|
|
297
|
+
k,
|
|
298
|
+
getRawRuleSetCondition(v)
|
|
299
|
+
]))
|
|
300
|
+
: undefined,
|
|
290
301
|
resource: rule.resource ? getRawRuleSetCondition(rule.resource) : undefined,
|
|
291
302
|
resourceQuery: rule.resourceQuery
|
|
292
303
|
? getRawRuleSetCondition(rule.resourceQuery)
|
|
@@ -301,6 +312,7 @@ const getRawModuleRule = (rule, path, options, upperType) => {
|
|
|
301
312
|
? funcUse
|
|
302
313
|
: (0, adapterRuleUse_1.createRawModuleRuleUses)(rule.use ?? [], `${path}.use`, options),
|
|
303
314
|
type: rule.type,
|
|
315
|
+
layer: rule.layer,
|
|
304
316
|
parser: rule.parser
|
|
305
317
|
? getRawParserOptions(rule.parser, rule.type ?? upperType)
|
|
306
318
|
: undefined,
|
|
@@ -458,6 +470,7 @@ function getRawJavascriptParserOptions(parser) {
|
|
|
458
470
|
dynamicImportPreload: parser.dynamicImportPreload?.toString() ?? "false",
|
|
459
471
|
dynamicImportPrefetch: parser.dynamicImportPrefetch?.toString() ?? "false",
|
|
460
472
|
dynamicImportFetchPriority: parser.dynamicImportFetchPriority?.toString(),
|
|
473
|
+
importMeta: parser.importMeta ?? true,
|
|
461
474
|
url: parser.url === false
|
|
462
475
|
? "false"
|
|
463
476
|
: parser.url === "relative"
|
|
@@ -629,9 +642,10 @@ function getRawSnapshotOptions(_snapshot) {
|
|
|
629
642
|
return {};
|
|
630
643
|
}
|
|
631
644
|
function getRawExperiments(experiments) {
|
|
632
|
-
const { topLevelAwait, rspackFuture } = experiments;
|
|
633
|
-
(0, node_assert_1.default)(!(0, util_1.isNil)(topLevelAwait) && !(0, util_1.isNil)(rspackFuture));
|
|
645
|
+
const { topLevelAwait, layers, rspackFuture } = experiments;
|
|
646
|
+
(0, node_assert_1.default)(!(0, util_1.isNil)(topLevelAwait) && !(0, util_1.isNil)(rspackFuture) && !(0, util_1.isNil)(layers));
|
|
634
647
|
return {
|
|
648
|
+
layers,
|
|
635
649
|
topLevelAwait,
|
|
636
650
|
rspackFuture: getRawRspackFutureOptions(rspackFuture)
|
|
637
651
|
};
|
|
@@ -102,12 +102,8 @@ export interface LoaderContext<OptionsType = {}> {
|
|
|
102
102
|
_compilation: Compilation;
|
|
103
103
|
_module: Module;
|
|
104
104
|
}
|
|
105
|
-
export
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
export interface PitchLoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> {
|
|
109
|
-
(this: LoaderContext<OptionsType> & ContextAdditions, remainingRequest: string, previousRequest: string, data: object): string | void | Buffer | Promise<string | Buffer>;
|
|
110
|
-
}
|
|
105
|
+
export type LoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, content: string, sourceMap?: string | SourceMap, additionalData?: AdditionalData) => string | void | Buffer | Promise<string | Buffer>;
|
|
106
|
+
export type PitchLoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, remainingRequest: string, previousRequest: string, data: object) => string | void | Buffer | Promise<string | Buffer>;
|
|
111
107
|
export type LoaderDefinition<OptionsType = {}, ContextAdditions = {}> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
|
112
108
|
raw?: false;
|
|
113
109
|
pitch?: PitchLoaderDefinitionFunction;
|
|
@@ -30,12 +30,12 @@ const getLightningcssLoaderOptions = (o, _) => {
|
|
|
30
30
|
o.targets = (0, lightningcss_1.browserslistToTargets)(browserslist(o.targets));
|
|
31
31
|
}
|
|
32
32
|
if (o.targets && Array.isArray(o.targets)) {
|
|
33
|
-
o.targets = (0, lightningcss_1.browserslistToTargets)(o.targets);
|
|
33
|
+
o.targets = (0, lightningcss_1.browserslistToTargets)(browserslist(o.targets));
|
|
34
34
|
}
|
|
35
|
-
if (o.include) {
|
|
35
|
+
if (o.include && typeof o.include === "object") {
|
|
36
36
|
o.include = (0, lightningcss_1.toFeatures)(o.include);
|
|
37
37
|
}
|
|
38
|
-
if (o.exclude) {
|
|
38
|
+
if (o.exclude && typeof o.exclude === "object") {
|
|
39
39
|
o.exclude = (0, lightningcss_1.toFeatures)(o.exclude);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -55,7 +55,8 @@ function createRawModuleRuleUsesImpl(uses, path, options) {
|
|
|
55
55
|
return [];
|
|
56
56
|
}
|
|
57
57
|
return uses.map((use, index) => {
|
|
58
|
-
let o
|
|
58
|
+
let o;
|
|
59
|
+
let isBuiltin = false;
|
|
59
60
|
if (use.loader.startsWith(exports.BUILTIN_LOADER_PREFIX)) {
|
|
60
61
|
o = getBuiltinLoaderOptions(use.loader, use.options, options);
|
|
61
62
|
o = (0, util_1.isNil)(o) ? undefined : typeof o === "string" ? o : JSON.stringify(o);
|
|
@@ -75,15 +76,15 @@ function resolveStringifyLoaders(use, path, compiler, isBuiltin) {
|
|
|
75
76
|
else if (use.options === undefined) {
|
|
76
77
|
}
|
|
77
78
|
else if (typeof use.options === "string")
|
|
78
|
-
obj.query =
|
|
79
|
+
obj.query = `?${use.options}`;
|
|
79
80
|
else if (use.ident)
|
|
80
|
-
obj.query =
|
|
81
|
+
obj.query = `??${(ident = use.ident)}`;
|
|
81
82
|
else if (typeof use.options === "object" && use.options.ident)
|
|
82
|
-
obj.query =
|
|
83
|
+
obj.query = `??${(ident = use.options.ident)}`;
|
|
83
84
|
else if (typeof use.options === "object")
|
|
84
|
-
obj.query =
|
|
85
|
+
obj.query = `??${(ident = path)}`;
|
|
85
86
|
else
|
|
86
|
-
obj.query =
|
|
87
|
+
obj.query = `?${JSON.stringify(use.options)}`;
|
|
87
88
|
if (use.options && typeof use.options === "object") {
|
|
88
89
|
if (!ident)
|
|
89
90
|
ident = "[[missing ident]]";
|