@rspack-debug/core 1.4.6 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/@swc/types/index.d.ts +4 -5
- package/compiled/@swc/types/package.json +1 -1
- package/compiled/glob-to-regexp/index.d.ts +11 -0
- package/compiled/glob-to-regexp/index.js +187 -0
- package/compiled/glob-to-regexp/package.json +1 -0
- package/compiled/watchpack/index.js +9 -149
- package/dist/Compilation.d.ts +13 -7
- package/dist/Compiler.d.ts +10 -10
- package/dist/MultiCompiler.d.ts +1 -1
- package/dist/NativeWatchFileSystem.d.ts +17 -0
- package/dist/NormalModule.d.ts +1 -1
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/Watching.d.ts +10 -1
- package/dist/builtin-loader/swc/index.d.ts +3 -3
- 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 +1 -1
- 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/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssChunkingPlugin.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/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.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/ModuleInfoHeaderPlugin.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/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.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/RemoveDuplicateModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RstestPlugin.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/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/index.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +20 -20
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +2 -2
- package/dist/config/devServer.d.ts +1 -1
- package/dist/config/normalization.d.ts +3 -2
- package/dist/config/types.d.ts +8 -3
- package/dist/container/ContainerPlugin.d.ts +1 -1
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/cssExtractLoader.js +53 -55
- package/dist/exports.d.ts +22 -62
- package/dist/index.js +7681 -7679
- package/dist/lib/Cache.d.ts +1 -1
- package/dist/lib/CacheFacade.d.ts +1 -1
- package/dist/loader-runner/utils.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/schema/config.d.ts +50 -49
- package/dist/schema/plugins.d.ts +7 -7
- package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
- package/dist/sharing/ProvideSharedPlugin.d.ts +1 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
- package/dist/util/fs.d.ts +10 -1
- package/dist/worker.js +19 -16
- package/hot/lazy-compilation-node.js +0 -2
- package/hot/lazy-compilation-web.js +0 -2
- package/package.json +13 -11
|
@@ -4,7 +4,7 @@ export declare const ProgressPlugin: {
|
|
|
4
4
|
new (progress?: ProgressPluginArgument): {
|
|
5
5
|
name: string;
|
|
6
6
|
_args: [progress?: ProgressPluginArgument];
|
|
7
|
-
affectedHooks: "done" | "compilation" | "
|
|
7
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
8
8
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("..").Compiler): void;
|
|
10
10
|
};
|
|
@@ -3,7 +3,7 @@ export declare const ProvidePlugin: {
|
|
|
3
3
|
new (provide: ProvidePluginOptions): {
|
|
4
4
|
name: string;
|
|
5
5
|
_args: [provide: ProvidePluginOptions];
|
|
6
|
-
affectedHooks: "done" | "compilation" | "
|
|
6
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
7
7
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("..").Compiler): void;
|
|
9
9
|
};
|
|
@@ -2,7 +2,7 @@ export declare const RealContentHashPlugin: {
|
|
|
2
2
|
new (): {
|
|
3
3
|
name: string;
|
|
4
4
|
_args: [];
|
|
5
|
-
affectedHooks: "done" | "compilation" | "
|
|
5
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
6
6
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("..").Compiler): void;
|
|
8
8
|
};
|
|
@@ -2,7 +2,7 @@ export declare const RemoveDuplicateModulesPlugin: {
|
|
|
2
2
|
new (): {
|
|
3
3
|
name: string;
|
|
4
4
|
_args: [];
|
|
5
|
-
affectedHooks: "done" | "compilation" | "
|
|
5
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
6
6
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("..").Compiler): void;
|
|
8
8
|
};
|
|
@@ -2,7 +2,7 @@ export declare const RemoveEmptyChunksPlugin: {
|
|
|
2
2
|
new (): {
|
|
3
3
|
name: string;
|
|
4
4
|
_args: [];
|
|
5
|
-
affectedHooks: "done" | "compilation" | "
|
|
5
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
6
6
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("..").Compiler): void;
|
|
8
8
|
};
|
|
@@ -14,7 +14,7 @@ declare const RsdoctorPluginImpl: {
|
|
|
14
14
|
new (c?: RsdoctorPluginOptions | undefined): {
|
|
15
15
|
name: string;
|
|
16
16
|
_args: [c?: RsdoctorPluginOptions | undefined];
|
|
17
|
-
affectedHooks: "done" | "compilation" | "
|
|
17
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
18
18
|
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
19
19
|
apply(compiler: Compiler): void;
|
|
20
20
|
};
|
|
@@ -4,7 +4,7 @@ export declare const RslibPlugin: {
|
|
|
4
4
|
new (rslib: RawRslibPluginOptions): {
|
|
5
5
|
name: string;
|
|
6
6
|
_args: [rslib: RawRslibPluginOptions];
|
|
7
|
-
affectedHooks: "done" | "compilation" | "
|
|
7
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
8
8
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("..").Compiler): void;
|
|
10
10
|
};
|
|
@@ -4,7 +4,7 @@ export declare const RstestPlugin: {
|
|
|
4
4
|
new (rstest: RawRstestPluginOptions): {
|
|
5
5
|
name: string;
|
|
6
6
|
_args: [rstest: RawRstestPluginOptions];
|
|
7
|
-
affectedHooks: "done" | "compilation" | "
|
|
7
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
8
8
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("..").Compiler): void;
|
|
10
10
|
};
|
|
@@ -4,7 +4,7 @@ export declare const RuntimeChunkPlugin: {
|
|
|
4
4
|
new (options: RawRuntimeChunkOptions): {
|
|
5
5
|
name: string;
|
|
6
6
|
_args: [options: RawRuntimeChunkOptions];
|
|
7
|
-
affectedHooks: "done" | "compilation" | "
|
|
7
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
8
8
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("..").Compiler): void;
|
|
10
10
|
};
|
|
@@ -7,7 +7,7 @@ export declare const RuntimePluginImpl: {
|
|
|
7
7
|
new (): {
|
|
8
8
|
name: string;
|
|
9
9
|
_args: [];
|
|
10
|
-
affectedHooks: "done" | "compilation" | "
|
|
10
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
11
11
|
raw(compiler: import("..").Compiler): binding.BuiltinPlugin;
|
|
12
12
|
apply(compiler: import("..").Compiler): void;
|
|
13
13
|
};
|
|
@@ -2,7 +2,7 @@ export declare const SideEffectsFlagPlugin: {
|
|
|
2
2
|
new (): {
|
|
3
3
|
name: string;
|
|
4
4
|
_args: [];
|
|
5
|
-
affectedHooks: "done" | "compilation" | "
|
|
5
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
6
6
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("..").Compiler): void;
|
|
8
8
|
};
|
|
@@ -12,7 +12,7 @@ export declare const SizeLimitsPlugin: {
|
|
|
12
12
|
maxAssetSize?: number;
|
|
13
13
|
maxEntrypointSize?: number;
|
|
14
14
|
}];
|
|
15
|
-
affectedHooks: "done" | "compilation" | "
|
|
15
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
16
16
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
17
17
|
apply(compiler: import("..").Compiler): void;
|
|
18
18
|
};
|
|
@@ -4,7 +4,7 @@ export declare const SourceMapDevToolPlugin: {
|
|
|
4
4
|
new (options: SourceMapDevToolPluginOptions): {
|
|
5
5
|
name: string;
|
|
6
6
|
_args: [options: SourceMapDevToolPluginOptions];
|
|
7
|
-
affectedHooks: "done" | "compilation" | "
|
|
7
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
8
8
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
9
|
apply(compiler: import("..").Compiler): void;
|
|
10
10
|
};
|
|
@@ -20,7 +20,7 @@ declare const NativeSubresourceIntegrityPlugin: {
|
|
|
20
20
|
new (options: NativeSubresourceIntegrityPluginOptions): {
|
|
21
21
|
name: string;
|
|
22
22
|
_args: [options: NativeSubresourceIntegrityPluginOptions];
|
|
23
|
-
affectedHooks: "done" | "compilation" | "
|
|
23
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
24
24
|
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
25
25
|
apply(compiler: Compiler): void;
|
|
26
26
|
};
|
|
@@ -205,7 +205,7 @@ export declare const SwcJsMinimizerRspackPlugin: {
|
|
|
205
205
|
new (options?: SwcJsMinimizerRspackPluginOptions | undefined): {
|
|
206
206
|
name: string;
|
|
207
207
|
_args: [options?: SwcJsMinimizerRspackPluginOptions | undefined];
|
|
208
|
-
affectedHooks: "done" | "compilation" | "
|
|
208
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
209
209
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
210
210
|
apply(compiler: import("..").Compiler): void;
|
|
211
211
|
};
|
|
@@ -2,7 +2,7 @@ export declare const WarnCaseSensitiveModulesPlugin: {
|
|
|
2
2
|
new (): {
|
|
3
3
|
name: string;
|
|
4
4
|
_args: [];
|
|
5
|
-
affectedHooks: "done" | "compilation" | "
|
|
5
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
6
6
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("..").Compiler): void;
|
|
8
8
|
};
|
|
@@ -14,7 +14,7 @@ export declare function create<T extends any[], R>(name: binding.BuiltinPluginNa
|
|
|
14
14
|
new (...args: T): {
|
|
15
15
|
name: string;
|
|
16
16
|
_args: T;
|
|
17
|
-
affectedHooks: "done" | "compilation" | "
|
|
17
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
18
18
|
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
19
19
|
apply(compiler: Compiler): void;
|
|
20
20
|
};
|
|
@@ -37,7 +37,7 @@ export declare function createNativePlugin<T extends any[], R>(name: CustomPlugi
|
|
|
37
37
|
new (...args: T): {
|
|
38
38
|
name: string;
|
|
39
39
|
_args: T;
|
|
40
|
-
affectedHooks: "done" | "compilation" | "
|
|
40
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
41
41
|
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
42
42
|
apply(compiler: Compiler): void;
|
|
43
43
|
};
|
|
@@ -7,7 +7,7 @@ declare const HtmlRspackPluginImpl: {
|
|
|
7
7
|
new (c?: HtmlRspackPluginOptions | undefined): {
|
|
8
8
|
name: string;
|
|
9
9
|
_args: [c?: HtmlRspackPluginOptions | undefined];
|
|
10
|
-
affectedHooks: "done" | "compilation" | "
|
|
10
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
11
11
|
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
12
12
|
apply(compiler: Compiler): void;
|
|
13
13
|
};
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
export { RspackBuiltinPlugin, createNativePlugin } from "./base";
|
|
2
1
|
export * from "./APIPlugin";
|
|
3
2
|
export * from "./ArrayPushCallbackChunkFormatPlugin";
|
|
4
3
|
export * from "./AssetModulesPlugin";
|
|
5
4
|
export * from "./AsyncWebAssemblyModulesPlugin";
|
|
6
5
|
export * from "./BannerPlugin";
|
|
7
6
|
export * from "./BundlerInfoRspackPlugin";
|
|
8
|
-
export
|
|
7
|
+
export { createNativePlugin, RspackBuiltinPlugin } from "./base";
|
|
9
8
|
export * from "./ChunkPrefetchPreloadPlugin";
|
|
9
|
+
export * from "./CircularDependencyRspackPlugin";
|
|
10
10
|
export * from "./CommonJsChunkFormatPlugin";
|
|
11
|
+
export * from "./ContextReplacementPlugin";
|
|
11
12
|
export * from "./CopyRspackPlugin";
|
|
12
|
-
export * from "./
|
|
13
|
+
export * from "./CssChunkingPlugin";
|
|
13
14
|
export * from "./CssModulesPlugin";
|
|
15
|
+
export * from "./css-extract/index";
|
|
14
16
|
export * from "./DataUriPlugin";
|
|
15
17
|
export * from "./DefinePlugin";
|
|
16
18
|
export * from "./DeterministicChunkIdsPlugin";
|
|
17
19
|
export * from "./DeterministicModuleIdsPlugin";
|
|
20
|
+
export * from "./DllEntryPlugin";
|
|
21
|
+
export * from "./DllReferenceAgencyPlugin";
|
|
18
22
|
export * from "./DynamicEntryPlugin";
|
|
19
23
|
export * from "./ElectronTargetPlugin";
|
|
20
24
|
export * from "./EnableChunkLoadingPlugin";
|
|
@@ -25,56 +29,52 @@ export * from "./EntryPlugin";
|
|
|
25
29
|
export * from "./EvalDevToolModulePlugin";
|
|
26
30
|
export * from "./EvalSourceMapDevToolPlugin";
|
|
27
31
|
export * from "./ExternalsPlugin";
|
|
32
|
+
export * from "./FetchCompileAsyncWasmPlugin";
|
|
28
33
|
export * from "./FileUriPlugin";
|
|
29
34
|
export * from "./FlagDependencyExportsPlugin";
|
|
30
35
|
export * from "./FlagDependencyUsagePlugin";
|
|
31
36
|
export * from "./HotModuleReplacementPlugin";
|
|
32
|
-
export * from "./html-plugin/index";
|
|
33
37
|
export * from "./HttpExternalsRspackPlugin";
|
|
34
38
|
export * from "./HttpUriPlugin";
|
|
39
|
+
export * from "./html-plugin/index";
|
|
35
40
|
export * from "./IgnorePlugin";
|
|
36
41
|
export * from "./InferAsyncModulesPlugin";
|
|
37
42
|
export * from "./JavascriptModulesPlugin";
|
|
38
43
|
export * from "./JsLoaderRspackPlugin";
|
|
39
44
|
export * from "./JsonModulesPlugin";
|
|
40
|
-
export * from "./
|
|
45
|
+
export * from "./LibManifestPlugin";
|
|
46
|
+
export * from "./LightningCssMinimizerRspackPlugin";
|
|
47
|
+
export * from "./LightningCssMinimizerRspackPlugin";
|
|
41
48
|
export * from "./LimitChunkCountPlugin";
|
|
49
|
+
export * from "./lazy-compilation/middleware";
|
|
42
50
|
export * from "./MangleExportsPlugin";
|
|
43
51
|
export * from "./MergeDuplicateChunksPlugin";
|
|
44
52
|
export * from "./ModuleChunkFormatPlugin";
|
|
45
53
|
export * from "./ModuleConcatenationPlugin";
|
|
54
|
+
export * from "./ModuleInfoHeaderPlugin";
|
|
46
55
|
export * from "./NamedChunkIdsPlugin";
|
|
47
56
|
export * from "./NamedModuleIdsPlugin";
|
|
48
57
|
export * from "./NaturalChunkIdsPlugin";
|
|
49
58
|
export * from "./NaturalModuleIdsPlugin";
|
|
50
59
|
export * from "./NodeTargetPlugin";
|
|
60
|
+
export * from "./NoEmitOnErrorsPlugin";
|
|
51
61
|
export * from "./OccurrenceChunkIdsPlugin";
|
|
52
62
|
export * from "./ProgressPlugin";
|
|
53
|
-
export * from "./RstestPlugin";
|
|
54
|
-
export * from "./RslibPlugin";
|
|
55
63
|
export * from "./ProvidePlugin";
|
|
56
64
|
export * from "./RealContentHashPlugin";
|
|
65
|
+
export * from "./RemoveDuplicateModulesPlugin";
|
|
57
66
|
export * from "./RemoveEmptyChunksPlugin";
|
|
67
|
+
export * from "./RsdoctorPlugin";
|
|
68
|
+
export * from "./RslibPlugin";
|
|
69
|
+
export * from "./RstestPlugin";
|
|
58
70
|
export * from "./RuntimeChunkPlugin";
|
|
59
71
|
export * from "./RuntimePlugin";
|
|
60
72
|
export * from "./SideEffectsFlagPlugin";
|
|
61
73
|
export * from "./SizeLimitsPlugin";
|
|
62
74
|
export * from "./SourceMapDevToolPlugin";
|
|
63
75
|
export * from "./SplitChunksPlugin";
|
|
64
|
-
export * from "./
|
|
65
|
-
export * from "./RemoveDuplicateModulesPlugin";
|
|
66
|
-
export * from "./LightningCssMinimizerRspackPlugin";
|
|
76
|
+
export * from "./SubresourceIntegrityPlugin";
|
|
67
77
|
export * from "./SwcJsMinimizerPlugin";
|
|
68
78
|
export * from "./WarnCaseSensitiveModulesPlugin";
|
|
69
79
|
export * from "./WebWorkerTemplatePlugin";
|
|
70
80
|
export * from "./WorkerPlugin";
|
|
71
|
-
export * from "./FetchCompileAsyncWasmPlugin";
|
|
72
|
-
export * from "./NoEmitOnErrorsPlugin";
|
|
73
|
-
export * from "./ContextReplacementPlugin";
|
|
74
|
-
export * from "./LibManifestPlugin";
|
|
75
|
-
export * from "./DllEntryPlugin";
|
|
76
|
-
export * from "./DllReferenceAgencyPlugin";
|
|
77
|
-
export * from "./RsdoctorPlugin";
|
|
78
|
-
export * from "./SubresourceIntegrityPlugin";
|
|
79
|
-
export * from "./ModuleInfoHeaderPlugin";
|
|
80
|
-
export * from "./CssChunkingPlugin";
|
|
@@ -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?: RegExp | ((module: Module) => boolean) | undefined];
|
|
20
|
-
affectedHooks: "done" | "compilation" | "
|
|
20
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
21
21
|
raw(compiler: import("../..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
22
22
|
apply(compiler: import("../..").Compiler): void;
|
|
23
23
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AssetInfo, RawModuleRuleUse, RawOptions } from "@rspack/binding";
|
|
2
2
|
import type { Compilation } from "../Compilation";
|
|
3
3
|
import type { Compiler } from "../Compiler";
|
|
4
|
-
import type { Module } from "../Module";
|
|
5
|
-
import type { ResolveRequest } from "../Resolver";
|
|
6
4
|
import { type LoaderObject } from "../loader-runner";
|
|
7
5
|
import type { Logger } from "../logging/Logger";
|
|
6
|
+
import type { Module } from "../Module";
|
|
7
|
+
import type { ResolveRequest } from "../Resolver";
|
|
8
8
|
import type Hash from "../util/hash";
|
|
9
9
|
import type { RspackOptionsNormalized } from "./normalization";
|
|
10
10
|
import type { Mode, PublicPath, Resolve, RuleSetUseItem, Target } from "./types";
|
|
@@ -133,7 +133,7 @@ type ProxyConfigArrayItem = {
|
|
|
133
133
|
type ByPass = (req: Request, res: Response, proxyConfig: ProxyConfigArrayItem) => any;
|
|
134
134
|
type ProxyConfigArray = (ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[];
|
|
135
135
|
type Callback = (stats?: Stats | MultiStats | undefined) => any;
|
|
136
|
-
type DevMiddlewareContext<
|
|
136
|
+
type DevMiddlewareContext<_RequestInternal extends IncomingMessage = IncomingMessage, _ResponseInternal extends ServerResponse = ServerResponse> = {
|
|
137
137
|
state: boolean;
|
|
138
138
|
stats: Stats | MultiStats | undefined;
|
|
139
139
|
callbacks: Callback[];
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compilation } from "../Compilation";
|
|
11
10
|
import type { HttpUriPluginOptions } from "../builtin-plugin";
|
|
11
|
+
import type { Compilation } from "../Compilation";
|
|
12
12
|
import type WebpackError from "../lib/WebpackError";
|
|
13
|
-
import type { Amd, AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name,
|
|
13
|
+
import type { Amd, AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
|
|
14
14
|
export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
|
|
15
15
|
export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
|
|
16
16
|
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
@@ -111,6 +111,7 @@ export interface ExperimentsNormalized {
|
|
|
111
111
|
inlineConst?: boolean;
|
|
112
112
|
inlineEnum?: boolean;
|
|
113
113
|
typeReexportsPresence?: boolean;
|
|
114
|
+
nativeWatcher?: boolean;
|
|
114
115
|
}
|
|
115
116
|
export type IgnoreWarningsNormalized = ((warning: WebpackError, compilation: Compilation) => boolean)[];
|
|
116
117
|
export type OptimizationRuntimeChunkNormalized = false | {
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AssetInfo, RawFuncUseCtx } from "@rspack/binding";
|
|
2
|
+
import type { HttpUriPluginOptions } from "../builtin-plugin/HttpUriPlugin";
|
|
2
3
|
import type { ChunkGraph } from "../ChunkGraph";
|
|
3
4
|
import type { Compilation, PathData } from "../Compilation";
|
|
4
5
|
import type { Compiler } from "../Compiler";
|
|
5
|
-
import type { Module } from "../Module";
|
|
6
|
-
import type ModuleGraph from "../ModuleGraph";
|
|
7
|
-
import type { HttpUriPluginOptions } from "../builtin-plugin/HttpUriPlugin";
|
|
8
6
|
import type { Chunk } from "../exports";
|
|
9
7
|
import type WebpackError from "../lib/WebpackError";
|
|
8
|
+
import type { Module } from "../Module";
|
|
9
|
+
import type ModuleGraph from "../ModuleGraph";
|
|
10
10
|
import type { ResolveCallback } from "./adapterRuleUse";
|
|
11
11
|
import type { DevServerOptions } from "./devServer";
|
|
12
12
|
export type FilenameTemplate = string;
|
|
@@ -2042,6 +2042,11 @@ export type Experiments = {
|
|
|
2042
2042
|
* @default false
|
|
2043
2043
|
*/
|
|
2044
2044
|
inlineConst?: boolean;
|
|
2045
|
+
/**
|
|
2046
|
+
* Enable native watcher
|
|
2047
|
+
* @default false
|
|
2048
|
+
*/
|
|
2049
|
+
nativeWatcher?: boolean;
|
|
2045
2050
|
/**
|
|
2046
2051
|
* Enable inline enum feature
|
|
2047
2052
|
* @default false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
|
-
import type { Compiler } from "../Compiler";
|
|
3
2
|
import { RspackBuiltinPlugin } from "../builtin-plugin/base";
|
|
3
|
+
import type { Compiler } from "../Compiler";
|
|
4
4
|
import type { EntryRuntime, FilenameTemplate, LibraryOptions } from "../config";
|
|
5
5
|
export type ContainerPluginOptions = {
|
|
6
6
|
exposes: Exposes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
|
-
import type { Compiler } from "../Compiler";
|
|
3
2
|
import { RspackBuiltinPlugin } from "../builtin-plugin/base";
|
|
3
|
+
import type { Compiler } from "../Compiler";
|
|
4
4
|
import type { ExternalsType } from "../config";
|
|
5
5
|
export type ContainerReferencePluginOptions = {
|
|
6
6
|
remoteType: ExternalsType;
|
|
@@ -2,7 +2,7 @@ export declare const ModuleFederationRuntimePlugin: {
|
|
|
2
2
|
new (): {
|
|
3
3
|
name: string;
|
|
4
4
|
_args: [];
|
|
5
|
-
affectedHooks: "done" | "compilation" | "
|
|
5
|
+
affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
6
6
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("..").Compiler): void;
|
|
8
8
|
};
|
package/dist/cssExtractLoader.js
CHANGED
|
@@ -82,66 +82,64 @@ let pitch = function(request, _, data) {
|
|
|
82
82
|
let options = this.getOptions(), emit = void 0 === options.emit || options.emit, callback = this.async(), filepath = this.resourcePath, parseMeta = this.__internal__parseMeta;
|
|
83
83
|
this.addDependency(filepath);
|
|
84
84
|
let { publicPath } = this._compilation.outputOptions;
|
|
85
|
-
"string" == typeof options.publicPath ? publicPath = options.publicPath : "function" == typeof options.publicPath && (publicPath = options.publicPath(this.resourcePath, this.rootContext)), "auto" === publicPath && (publicPath = AUTO_PUBLIC_PATH), publicPathForExtract = "string" == typeof publicPath ? /^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(publicPath) ? publicPath : `${ABSOLUTE_PUBLIC_PATH}${publicPath.replace(/\./g, SINGLE_DOT_PATH_SEGMENT)}` : publicPath
|
|
86
|
-
let handleExports = (originalExports)=>{
|
|
87
|
-
let locals, namedExport, esModule = void 0 === options.esModule || options.esModule, dependencies = [];
|
|
88
|
-
try {
|
|
89
|
-
let exports1 = originalExports.__esModule ? originalExports.default : originalExports;
|
|
90
|
-
if (namedExport = originalExports.__esModule && (!originalExports.default || !("locals" in originalExports.default))) for (let key of Object.keys(originalExports))"default" !== key && (locals || (locals = {}), locals[key] = originalExports[key]);
|
|
91
|
-
else locals = exports1?.locals;
|
|
92
|
-
if (Array.isArray(exports1) && emit) {
|
|
93
|
-
let identifierCountMap = new Map();
|
|
94
|
-
dependencies = exports1.map(([id, content, media, sourceMap, supports, layer])=>{
|
|
95
|
-
let context = this.rootContext, count = identifierCountMap.get(id) || 0;
|
|
96
|
-
return identifierCountMap.set(id, count + 1), {
|
|
97
|
-
identifier: id,
|
|
98
|
-
context,
|
|
99
|
-
content,
|
|
100
|
-
media,
|
|
101
|
-
supports,
|
|
102
|
-
layer,
|
|
103
|
-
identifierIndex: count,
|
|
104
|
-
sourceMap: sourceMap ? JSON.stringify(sourceMap) : void 0,
|
|
105
|
-
filepath
|
|
106
|
-
};
|
|
107
|
-
}).filter((item)=>null !== item);
|
|
108
|
-
}
|
|
109
|
-
} catch (e) {
|
|
110
|
-
callback(e);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
let result = function() {
|
|
114
|
-
if (locals) {
|
|
115
|
-
if (namedExport) {
|
|
116
|
-
let identifiers = Array.from(function*() {
|
|
117
|
-
let identifierId = 0;
|
|
118
|
-
for (let key of Object.keys(locals))identifierId += 1, yield [
|
|
119
|
-
`_${identifierId.toString(16)}`,
|
|
120
|
-
key
|
|
121
|
-
];
|
|
122
|
-
}()), localsString = identifiers.map(([id, key])=>{
|
|
123
|
-
var value;
|
|
124
|
-
return `\nvar ${id} = ${"function" == typeof (value = locals[key]) ? value.toString() : JSON.stringify(value)};`;
|
|
125
|
-
}).join(""), exportsString = `export { ${identifiers.map(([id, key])=>`${id} as ${JSON.stringify(key)}`).join(", ")} }`;
|
|
126
|
-
return void 0 !== options.defaultExport && options.defaultExport ? `${localsString}\n${exportsString}\nexport default { ${identifiers.map(([id, key])=>`${JSON.stringify(key)}: ${id}`).join(", ")} }\n` : `${localsString}\n${exportsString}\n`;
|
|
127
|
-
}
|
|
128
|
-
return `\n${esModule ? "export default" : "module.exports = "} ${JSON.stringify(locals)};`;
|
|
129
|
-
}
|
|
130
|
-
return esModule ? "\nexport {};" : "";
|
|
131
|
-
}(), resultSource = `// extracted by ${PLUGIN_NAME}`;
|
|
132
|
-
resultSource += this.hot && emit ? hotLoader(result, {
|
|
133
|
-
loaderContext: this,
|
|
134
|
-
options,
|
|
135
|
-
locals: locals
|
|
136
|
-
}) : result, dependencies.length > 0 && (parseMeta[PLUGIN_NAME] = JSON.stringify(dependencies)), callback(null, resultSource, void 0, data);
|
|
137
|
-
};
|
|
138
|
-
this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!${request}`, {
|
|
85
|
+
"string" == typeof options.publicPath ? publicPath = options.publicPath : "function" == typeof options.publicPath && (publicPath = options.publicPath(this.resourcePath, this.rootContext)), "auto" === publicPath && (publicPath = AUTO_PUBLIC_PATH), publicPathForExtract = "string" == typeof publicPath ? /^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(publicPath) ? publicPath : `${ABSOLUTE_PUBLIC_PATH}${publicPath.replace(/\./g, SINGLE_DOT_PATH_SEGMENT)}` : publicPath, this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!${request}`, {
|
|
139
86
|
layer: options.layer,
|
|
140
87
|
publicPath: publicPathForExtract,
|
|
141
88
|
baseUri: `${BASE_URI}/`
|
|
142
89
|
}, (error, exports1)=>{
|
|
143
90
|
if (error) return void callback(error);
|
|
144
|
-
|
|
91
|
+
((originalExports)=>{
|
|
92
|
+
let locals, namedExport, esModule = void 0 === options.esModule || options.esModule, dependencies = [];
|
|
93
|
+
try {
|
|
94
|
+
let exports1 = originalExports.__esModule ? originalExports.default : originalExports;
|
|
95
|
+
if (namedExport = originalExports.__esModule && (!originalExports.default || !("locals" in originalExports.default))) for (let key of Object.keys(originalExports))"default" !== key && (locals || (locals = {}), locals[key] = originalExports[key]);
|
|
96
|
+
else locals = exports1?.locals;
|
|
97
|
+
if (Array.isArray(exports1) && emit) {
|
|
98
|
+
let identifierCountMap = new Map();
|
|
99
|
+
dependencies = exports1.map(([id, content, media, sourceMap, supports, layer])=>{
|
|
100
|
+
let context = this.rootContext, count = identifierCountMap.get(id) || 0;
|
|
101
|
+
return identifierCountMap.set(id, count + 1), {
|
|
102
|
+
identifier: id,
|
|
103
|
+
context,
|
|
104
|
+
content,
|
|
105
|
+
media,
|
|
106
|
+
supports,
|
|
107
|
+
layer,
|
|
108
|
+
identifierIndex: count,
|
|
109
|
+
sourceMap: sourceMap ? JSON.stringify(sourceMap) : void 0,
|
|
110
|
+
filepath
|
|
111
|
+
};
|
|
112
|
+
}).filter((item)=>null !== item);
|
|
113
|
+
}
|
|
114
|
+
} catch (e) {
|
|
115
|
+
callback(e);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
let result = function() {
|
|
119
|
+
if (locals) {
|
|
120
|
+
if (namedExport) {
|
|
121
|
+
let identifiers = Array.from(function*() {
|
|
122
|
+
let identifierId = 0;
|
|
123
|
+
for (let key of Object.keys(locals))identifierId += 1, yield [
|
|
124
|
+
`_${identifierId.toString(16)}`,
|
|
125
|
+
key
|
|
126
|
+
];
|
|
127
|
+
}()), localsString = identifiers.map(([id, key])=>{
|
|
128
|
+
var value;
|
|
129
|
+
return `\nvar ${id} = ${"function" == typeof (value = locals[key]) ? value.toString() : JSON.stringify(value)};`;
|
|
130
|
+
}).join(""), exportsString = `export { ${identifiers.map(([id, key])=>`${id} as ${JSON.stringify(key)}`).join(", ")} }`;
|
|
131
|
+
return void 0 !== options.defaultExport && options.defaultExport ? `${localsString}\n${exportsString}\nexport default { ${identifiers.map(([id, key])=>`${JSON.stringify(key)}: ${id}`).join(", ")} }\n` : `${localsString}\n${exportsString}\n`;
|
|
132
|
+
}
|
|
133
|
+
return `\n${esModule ? "export default" : "module.exports = "} ${JSON.stringify(locals)};`;
|
|
134
|
+
}
|
|
135
|
+
return esModule ? "\nexport {};" : "";
|
|
136
|
+
}(), resultSource = `// extracted by ${PLUGIN_NAME}`;
|
|
137
|
+
resultSource += this.hot && emit ? hotLoader(result, {
|
|
138
|
+
loaderContext: this,
|
|
139
|
+
options,
|
|
140
|
+
locals: locals
|
|
141
|
+
}) : result, dependencies.length > 0 && (parseMeta[PLUGIN_NAME] = JSON.stringify(dependencies)), callback(null, resultSource, void 0, data);
|
|
142
|
+
})(exports1);
|
|
145
143
|
});
|
|
146
144
|
}, css_extract_loader = function(content) {
|
|
147
145
|
if (this._compiler?.options?.experiments?.css && this._module && ("css" === this._module.type || "css/auto" === this._module.type || "css/global" === this._module.type || "css/module" === this._module.type)) return content;
|