2018-12-09 21:26:35 +08:00
/ *
MIT License http : //www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @ sokra
* /
"use strict" ;
const util = require ( "util" ) ;
2020-12-27 05:32:57 +08:00
const memoize = require ( "./util/memoize" ) ;
2018-12-09 21:26:35 +08:00
2020-04-23 03:21:30 +08:00
/** @typedef {import("../declarations/WebpackOptions").Entry} Entry */
/** @typedef {import("../declarations/WebpackOptions").EntryNormalized} EntryNormalized */
2021-01-30 15:05:45 +08:00
/** @typedef {import("../declarations/WebpackOptions").EntryObject} EntryObject */
2025-05-01 22:36:51 +08:00
/** @typedef {import("../declarations/WebpackOptions").ExternalItem} ExternalItem */
/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunction} ExternalItemFunction */
/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunctionCallback} ExternalItemFunctionCallback */
2021-02-24 20:57:20 +08:00
/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunctionData} ExternalItemFunctionData */
2025-05-01 22:36:51 +08:00
/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunctionDataGetResolve} ExternalItemFunctionDataGetResolve */
/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunctionDataGetResolveCallbackResult} ExternalItemFunctionDataGetResolveCallbackResult */
/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunctionDataGetResolveResult} ExternalItemFunctionDataGetResolveResult */
/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunctionPromise} ExternalItemFunctionPromise */
2021-02-24 20:59:29 +08:00
/** @typedef {import("../declarations/WebpackOptions").ExternalItemObjectKnown} ExternalItemObjectKnown */
2021-02-24 21:00:22 +08:00
/** @typedef {import("../declarations/WebpackOptions").ExternalItemObjectUnknown} ExternalItemObjectUnknown */
2021-02-24 20:58:25 +08:00
/** @typedef {import("../declarations/WebpackOptions").ExternalItemValue} ExternalItemValue */
2021-02-24 20:56:23 +08:00
/** @typedef {import("../declarations/WebpackOptions").Externals} Externals */
2022-02-13 01:43:48 +08:00
/** @typedef {import("../declarations/WebpackOptions").FileCacheOptions} FileCacheOptions */
2025-05-01 22:36:51 +08:00
/** @typedef {import("../declarations/WebpackOptions").GeneratorOptionsByModuleTypeKnown} GeneratorOptionsByModuleTypeKnown */
2020-04-23 03:21:30 +08:00
/** @typedef {import("../declarations/WebpackOptions").LibraryOptions} LibraryOptions */
2023-04-24 22:38:43 +08:00
/** @typedef {import("../declarations/WebpackOptions").MemoryCacheOptions} MemoryCacheOptions */
2020-04-23 03:21:30 +08:00
/** @typedef {import("../declarations/WebpackOptions").ModuleOptions} ModuleOptions */
2025-05-01 22:36:51 +08:00
/** @typedef {import("../declarations/WebpackOptions").ParserOptionsByModuleTypeKnown} ParserOptionsByModuleTypeKnown */
2020-04-23 03:21:30 +08:00
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
2020-10-08 16:35:58 +08:00
/** @typedef {import("../declarations/WebpackOptions").RuleSetCondition} RuleSetCondition */
2020-10-08 16:37:46 +08:00
/** @typedef {import("../declarations/WebpackOptions").RuleSetConditionAbsolute} RuleSetConditionAbsolute */
2020-04-23 03:21:30 +08:00
/** @typedef {import("../declarations/WebpackOptions").RuleSetRule} RuleSetRule */
2020-10-08 16:39:05 +08:00
/** @typedef {import("../declarations/WebpackOptions").RuleSetUse} RuleSetUse */
2025-05-01 22:36:51 +08:00
/** @typedef {import("../declarations/WebpackOptions").RuleSetUseFunction} RuleSetUseFunction */
2020-10-08 16:40:00 +08:00
/** @typedef {import("../declarations/WebpackOptions").RuleSetUseItem} RuleSetUseItem */
2021-03-12 03:54:53 +08:00
/** @typedef {import("../declarations/WebpackOptions").StatsOptions} StatsOptions */
2020-03-21 21:01:38 +08:00
/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} Configuration */
2020-04-23 03:21:30 +08:00
/** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptionsNormalized */
2020-04-20 13:36:55 +08:00
/** @typedef {import("../declarations/WebpackOptions").WebpackPluginFunction} WebpackPluginFunction */
/** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */
2023-05-17 05:43:02 +08:00
/** @typedef {import("./ChunkGroup")} ChunkGroup */
2020-12-17 17:07:29 +08:00
/** @typedef {import("./Compilation").Asset} Asset */
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
2022-02-13 01:43:48 +08:00
/** @typedef {import("./Compilation").EntryOptions} EntryOptions */
2022-05-01 19:12:42 +08:00
/** @typedef {import("./Compilation").PathData} PathData */
2022-02-13 01:43:48 +08:00
/** @typedef {import("./Compiler").AssetEmittedInfo} AssetEmittedInfo */
2025-05-01 22:36:51 +08:00
/** @typedef {import("./Entrypoint")} Entrypoint */
2023-09-12 10:59:41 +08:00
/** @typedef {import("./MultiCompiler").MultiCompilerOptions} MultiCompilerOptions */
2025-07-18 20:28:16 +08:00
/** @typedef {import("./MultiCompiler").MultiWebpackOptions} MultiConfiguration */
2021-02-04 21:49:22 +08:00
/** @typedef {import("./MultiStats")} MultiStats */
2025-07-18 20:28:16 +08:00
/** @typedef {import("./MultiStats").MultiStatsOptions} MultiStatsOptions */
2023-05-16 22:49:07 +08:00
/** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */
2020-04-20 13:36:55 +08:00
/** @typedef {import("./Parser").ParserState} ParserState */
2021-03-12 03:54:53 +08:00
/** @typedef {import("./ResolverFactory").ResolvePluginInstance} ResolvePluginInstance */
/** @typedef {import("./ResolverFactory").Resolver} Resolver */
2025-08-12 03:57:31 +08:00
/** @typedef {import("./Template").RenderManifestEntry} RenderManifestEntry */
/** @typedef {import("./Template").RenderManifestOptions} RenderManifestOptions */
/** @typedef {import("./TemplatedPathPlugin").TemplatePath} TemplatePath */
2021-02-21 17:53:38 +08:00
/** @typedef {import("./Watching")} Watching */
2022-02-13 01:43:48 +08:00
/** @typedef {import("./cli").Argument} Argument */
/** @typedef {import("./cli").Problem} Problem */
2025-07-18 20:28:16 +08:00
/** @typedef {import("./cli").Colors} Colors */
/** @typedef {import("./cli").ColorsOptions} ColorsOptions */
2021-03-30 05:02:31 +08:00
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsAsset} StatsAsset */
2021-03-31 19:36:37 +08:00
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsChunk} StatsChunk */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsChunkGroup} StatsChunkGroup */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsChunkOrigin} StatsChunkOrigin */
2021-02-21 17:59:17 +08:00
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsCompilation} StatsCompilation */
2021-03-31 19:36:37 +08:00
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsError} StatsError */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsLogging} StatsLogging */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsLoggingEntry} StatsLoggingEntry */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsModule} StatsModule */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsModuleIssuer} StatsModuleIssuer */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsModuleReason} StatsModuleReason */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsModuleTraceDependency} StatsModuleTraceDependency */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsModuleTraceItem} StatsModuleTraceItem */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsProfile} StatsProfile */
2025-08-05 19:31:29 +08:00
/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
2024-03-21 20:12:38 +08:00
/** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */
/** @typedef {import("./util/fs").OutputFileSystem} OutputFileSystem */
2020-03-21 21:01:38 +08:00
2020-04-20 13:36:55 +08:00
/ * *
2025-03-14 00:34:04 +08:00
* @ template { EXPECTED _FUNCTION } T
2025-03-12 09:56:14 +08:00
* @ param { ( ) => T } factory factory function
2020-04-20 13:36:55 +08:00
* @ returns { T } function
* /
2025-07-17 00:13:14 +08:00
const lazyFunction = ( factory ) => {
2020-12-27 05:32:57 +08:00
const fac = memoize ( factory ) ;
2025-04-16 22:04:11 +08:00
const f = /** @type {unknown} */ (
2024-10-24 11:02:20 +08:00
/ * *
2025-04-03 00:02:22 +08:00
* @ param { ... EXPECTED _ANY } args args
2024-10-24 11:02:20 +08:00
* @ returns { T } result
* /
( ... args ) => fac ( ) ( ... args )
) ;
2020-04-20 13:36:55 +08:00
return /** @type {T} */ ( f ) ;
} ;
/ * *
* @ template A
* @ template B
* @ param { A } obj input a
* @ param { B } exports input b
* @ returns { A & B } merged
* /
const mergeExports = ( obj , exports ) => {
const descriptors = Object . getOwnPropertyDescriptors ( exports ) ;
for ( const name of Object . keys ( descriptors ) ) {
const descriptor = descriptors [ name ] ;
if ( descriptor . get ) {
const fn = descriptor . get ;
Object . defineProperty ( obj , name , {
configurable : false ,
enumerable : true ,
2020-12-27 05:32:57 +08:00
get : memoize ( fn )
2020-04-20 13:36:55 +08:00
} ) ;
} else if ( typeof descriptor . value === "object" ) {
Object . defineProperty ( obj , name , {
configurable : false ,
enumerable : true ,
writable : false ,
value : mergeExports ( { } , descriptor . value )
} ) ;
} else {
throw new Error (
"Exposed values must be either a getter or an nested object"
) ;
}
}
return /** @type {A & B} */ ( Object . freeze ( obj ) ) ;
} ;
const fn = lazyFunction ( ( ) => require ( "./webpack" ) ) ;
2025-07-02 20:10:54 +08:00
2020-04-20 13:36:55 +08:00
module . exports = mergeExports ( fn , {
get webpack ( ) {
return require ( "./webpack" ) ;
} ,
2024-10-24 11:02:20 +08:00
/ * *
2025-07-18 20:28:16 +08:00
* @ returns { ( configuration : Configuration | MultiConfiguration ) => void } validate fn
2024-10-24 11:02:20 +08:00
* /
2020-04-20 13:36:55 +08:00
get validate ( ) {
2025-07-09 18:59:21 +08:00
const webpackOptionsSchemaCheck =
2025-07-18 20:28:16 +08:00
/** @type {(configuration: Configuration | MultiConfiguration) => boolean} */
2025-07-09 18:59:21 +08:00
( require ( "../schemas/WebpackOptions.check" ) ) ;
2025-07-02 20:10:54 +08:00
2024-10-24 11:02:20 +08:00
const getRealValidate = memoize (
/ * *
2025-07-18 20:28:16 +08:00
* @ returns { ( configuration : Configuration | MultiConfiguration ) => void } validate fn
2024-10-24 11:02:20 +08:00
* /
( ) => {
const validateSchema = require ( "./validateSchema" ) ;
const webpackOptionsSchema = require ( "../schemas/WebpackOptions.json" ) ;
2025-07-02 20:10:54 +08:00
2025-07-17 00:13:14 +08:00
return ( options ) => validateSchema ( webpackOptionsSchema , options ) ;
2024-10-24 11:02:20 +08:00
}
) ;
2025-07-17 00:13:14 +08:00
return ( options ) => {
2025-07-09 18:59:21 +08:00
if ( ! webpackOptionsSchemaCheck ( options ) ) {
2024-11-01 18:48:22 +08:00
getRealValidate ( ) ( options ) ;
2025-07-02 20:10:54 +08:00
}
2021-04-16 21:35:18 +08:00
} ;
2020-04-20 13:36:55 +08:00
} ,
get validateSchema ( ) {
const validateSchema = require ( "./validateSchema" ) ;
2025-07-02 20:10:54 +08:00
2020-04-20 13:36:55 +08:00
return validateSchema ;
} ,
get version ( ) {
2020-04-21 14:54:59 +08:00
return /** @type {string} */ ( require ( "../package.json" ) . version ) ;
2020-04-20 13:36:55 +08:00
} ,
2018-12-09 21:26:35 +08:00
2020-03-21 21:01:38 +08:00
get cli ( ) {
return require ( "./cli" ) ;
} ,
get AutomaticPrefetchPlugin ( ) {
return require ( "./AutomaticPrefetchPlugin" ) ;
} ,
2021-03-25 21:37:20 +08:00
get AsyncDependenciesBlock ( ) {
return require ( "./AsyncDependenciesBlock" ) ;
} ,
2020-03-21 21:01:38 +08:00
get BannerPlugin ( ) {
return require ( "./BannerPlugin" ) ;
} ,
get Cache ( ) {
return require ( "./Cache" ) ;
} ,
2020-04-20 13:36:55 +08:00
get Chunk ( ) {
return require ( "./Chunk" ) ;
} ,
get ChunkGraph ( ) {
return require ( "./ChunkGraph" ) ;
} ,
2020-10-02 23:08:03 +08:00
get CleanPlugin ( ) {
return require ( "./CleanPlugin" ) ;
} ,
2020-03-21 21:01:38 +08:00
get Compilation ( ) {
return require ( "./Compilation" ) ;
} ,
get Compiler ( ) {
return require ( "./Compiler" ) ;
} ,
2020-09-15 16:56:06 +08:00
get ConcatenationScope ( ) {
return require ( "./ConcatenationScope" ) ;
} ,
2020-03-21 21:01:38 +08:00
get ContextExclusionPlugin ( ) {
return require ( "./ContextExclusionPlugin" ) ;
} ,
get ContextReplacementPlugin ( ) {
return require ( "./ContextReplacementPlugin" ) ;
} ,
get DefinePlugin ( ) {
return require ( "./DefinePlugin" ) ;
} ,
get DelegatedPlugin ( ) {
return require ( "./DelegatedPlugin" ) ;
} ,
get Dependency ( ) {
return require ( "./Dependency" ) ;
} ,
get DllPlugin ( ) {
return require ( "./DllPlugin" ) ;
} ,
get DllReferencePlugin ( ) {
return require ( "./DllReferencePlugin" ) ;
} ,
2020-10-12 15:39:43 +08:00
get DynamicEntryPlugin ( ) {
return require ( "./DynamicEntryPlugin" ) ;
} ,
2020-10-12 15:37:07 +08:00
get EntryOptionPlugin ( ) {
return require ( "./EntryOptionPlugin" ) ;
} ,
2020-03-21 21:01:38 +08:00
get EntryPlugin ( ) {
return require ( "./EntryPlugin" ) ;
} ,
get EnvironmentPlugin ( ) {
return require ( "./EnvironmentPlugin" ) ;
} ,
get EvalDevToolModulePlugin ( ) {
return require ( "./EvalDevToolModulePlugin" ) ;
} ,
get EvalSourceMapDevToolPlugin ( ) {
return require ( "./EvalSourceMapDevToolPlugin" ) ;
} ,
2020-04-20 13:36:55 +08:00
get ExternalModule ( ) {
return require ( "./ExternalModule" ) ;
} ,
2020-03-21 21:01:38 +08:00
get ExternalsPlugin ( ) {
return require ( "./ExternalsPlugin" ) ;
} ,
get Generator ( ) {
return require ( "./Generator" ) ;
} ,
2020-09-25 02:29:08 +08:00
get HotUpdateChunk ( ) {
return require ( "./HotUpdateChunk" ) ;
} ,
2020-03-21 21:01:38 +08:00
get HotModuleReplacementPlugin ( ) {
return require ( "./HotModuleReplacementPlugin" ) ;
} ,
2024-03-22 07:02:04 +08:00
get InitFragment ( ) {
return require ( "./InitFragment" ) ;
} ,
2020-03-21 21:01:38 +08:00
get IgnorePlugin ( ) {
return require ( "./IgnorePlugin" ) ;
} ,
get JavascriptModulesPlugin ( ) {
return util . deprecate (
( ) => require ( "./javascript/JavascriptModulesPlugin" ) ,
"webpack.JavascriptModulesPlugin has moved to webpack.javascript.JavascriptModulesPlugin" ,
"DEP_WEBPACK_JAVASCRIPT_MODULES_PLUGIN"
) ( ) ;
} ,
get LibManifestPlugin ( ) {
return require ( "./LibManifestPlugin" ) ;
} ,
get LibraryTemplatePlugin ( ) {
return util . deprecate (
( ) => require ( "./LibraryTemplatePlugin" ) ,
"webpack.LibraryTemplatePlugin is deprecated and has been replaced by compilation.outputOptions.library or compilation.addEntry + passing a library option" ,
"DEP_WEBPACK_LIBRARY_TEMPLATE_PLUGIN"
) ( ) ;
} ,
get LoaderOptionsPlugin ( ) {
return require ( "./LoaderOptionsPlugin" ) ;
} ,
get LoaderTargetPlugin ( ) {
return require ( "./LoaderTargetPlugin" ) ;
} ,
get Module ( ) {
return require ( "./Module" ) ;
} ,
2025-08-12 03:57:31 +08:00
get ModuleFactory ( ) {
return require ( "./ModuleFactory" ) ;
} ,
2020-03-21 21:01:38 +08:00
get ModuleFilenameHelpers ( ) {
return require ( "./ModuleFilenameHelpers" ) ;
} ,
2020-04-20 13:36:55 +08:00
get ModuleGraph ( ) {
return require ( "./ModuleGraph" ) ;
} ,
2020-10-05 22:57:31 +08:00
get ModuleGraphConnection ( ) {
return require ( "./ModuleGraphConnection" ) ;
} ,
2020-03-21 21:01:38 +08:00
get NoEmitOnErrorsPlugin ( ) {
return require ( "./NoEmitOnErrorsPlugin" ) ;
} ,
get NormalModule ( ) {
return require ( "./NormalModule" ) ;
} ,
get NormalModuleReplacementPlugin ( ) {
return require ( "./NormalModuleReplacementPlugin" ) ;
} ,
get MultiCompiler ( ) {
return require ( "./MultiCompiler" ) ;
} ,
2023-09-12 11:17:22 +08:00
get OptimizationStages ( ) {
return require ( "./OptimizationStages" ) ;
} ,
2020-03-21 21:01:38 +08:00
get Parser ( ) {
return require ( "./Parser" ) ;
} ,
2024-05-01 22:22:45 +08:00
get PlatformPlugin ( ) {
return require ( "./PlatformPlugin" ) ;
} ,
2020-03-21 21:01:38 +08:00
get PrefetchPlugin ( ) {
return require ( "./PrefetchPlugin" ) ;
} ,
get ProgressPlugin ( ) {
return require ( "./ProgressPlugin" ) ;
} ,
get ProvidePlugin ( ) {
return require ( "./ProvidePlugin" ) ;
} ,
get RuntimeGlobals ( ) {
return require ( "./RuntimeGlobals" ) ;
} ,
get RuntimeModule ( ) {
return require ( "./RuntimeModule" ) ;
} ,
get SingleEntryPlugin ( ) {
return util . deprecate (
( ) => require ( "./EntryPlugin" ) ,
"SingleEntryPlugin was renamed to EntryPlugin" ,
"DEP_WEBPACK_SINGLE_ENTRY_PLUGIN"
) ( ) ;
} ,
get SourceMapDevToolPlugin ( ) {
return require ( "./SourceMapDevToolPlugin" ) ;
} ,
get Stats ( ) {
return require ( "./Stats" ) ;
} ,
get Template ( ) {
return require ( "./Template" ) ;
} ,
2020-07-28 01:36:06 +08:00
get UsageState ( ) {
return require ( "./ExportsInfo" ) . UsageState ;
} ,
2020-03-21 21:01:38 +08:00
get WatchIgnorePlugin ( ) {
return require ( "./WatchIgnorePlugin" ) ;
} ,
2020-12-17 17:08:27 +08:00
get WebpackError ( ) {
return require ( "./WebpackError" ) ;
} ,
2020-04-20 13:36:55 +08:00
get WebpackOptionsApply ( ) {
return require ( "./WebpackOptionsApply" ) ;
} ,
2020-03-21 21:01:38 +08:00
get WebpackOptionsDefaulter ( ) {
return util . deprecate (
( ) => require ( "./WebpackOptionsDefaulter" ) ,
"webpack.WebpackOptionsDefaulter is deprecated and has been replaced by webpack.config.getNormalizedWebpackOptions and webpack.config.applyWebpackOptionsDefaults" ,
"DEP_WEBPACK_OPTIONS_DEFAULTER"
) ( ) ;
} ,
2020-02-17 17:27:46 +08:00
// TODO webpack 6 deprecate
2020-03-21 21:01:38 +08:00
get WebpackOptionsValidationError ( ) {
2020-04-20 13:36:55 +08:00
return require ( "schema-utils" ) . ValidationError ;
2020-03-21 21:01:38 +08:00
} ,
get ValidationError ( ) {
2020-04-20 13:36:55 +08:00
return require ( "schema-utils" ) . ValidationError ;
2020-03-21 21:01:38 +08:00
} ,
2018-12-09 21:26:35 +08:00
2020-03-21 21:01:38 +08:00
cache : {
get MemoryCachePlugin ( ) {
return require ( "./cache/MemoryCachePlugin" ) ;
}
} ,
2018-12-09 21:26:35 +08:00
2020-03-21 21:01:38 +08:00
config : {
get getNormalizedWebpackOptions ( ) {
return require ( "./config/normalization" ) . getNormalizedWebpackOptions ;
} ,
get applyWebpackOptionsDefaults ( ) {
return require ( "./config/defaults" ) . applyWebpackOptionsDefaults ;
}
} ,
2020-02-17 17:27:46 +08:00
2021-03-31 22:39:43 +08:00
dependencies : {
get ModuleDependency ( ) {
return require ( "./dependencies/ModuleDependency" ) ;
} ,
2022-07-10 14:25:56 +08:00
get HarmonyImportDependency ( ) {
return require ( "./dependencies/HarmonyImportDependency" ) ;
} ,
2021-03-31 22:39:43 +08:00
get ConstDependency ( ) {
return require ( "./dependencies/ConstDependency" ) ;
} ,
get NullDependency ( ) {
return require ( "./dependencies/NullDependency" ) ;
}
} ,
2020-03-21 21:01:38 +08:00
ids : {
get ChunkModuleIdRangePlugin ( ) {
return require ( "./ids/ChunkModuleIdRangePlugin" ) ;
} ,
get NaturalModuleIdsPlugin ( ) {
return require ( "./ids/NaturalModuleIdsPlugin" ) ;
} ,
get OccurrenceModuleIdsPlugin ( ) {
return require ( "./ids/OccurrenceModuleIdsPlugin" ) ;
} ,
get NamedModuleIdsPlugin ( ) {
return require ( "./ids/NamedModuleIdsPlugin" ) ;
} ,
2020-03-26 20:50:16 +08:00
get DeterministicChunkIdsPlugin ( ) {
return require ( "./ids/DeterministicChunkIdsPlugin" ) ;
} ,
2020-03-21 21:01:38 +08:00
get DeterministicModuleIdsPlugin ( ) {
return require ( "./ids/DeterministicModuleIdsPlugin" ) ;
} ,
get NamedChunkIdsPlugin ( ) {
return require ( "./ids/NamedChunkIdsPlugin" ) ;
} ,
get OccurrenceChunkIdsPlugin ( ) {
return require ( "./ids/OccurrenceChunkIdsPlugin" ) ;
} ,
get HashedModuleIdsPlugin ( ) {
return require ( "./ids/HashedModuleIdsPlugin" ) ;
}
} ,
2018-12-09 21:26:35 +08:00
2020-03-21 21:01:38 +08:00
javascript : {
2020-08-26 03:45:56 +08:00
get EnableChunkLoadingPlugin ( ) {
return require ( "./javascript/EnableChunkLoadingPlugin" ) ;
} ,
2020-03-21 21:01:38 +08:00
get JavascriptModulesPlugin ( ) {
return require ( "./javascript/JavascriptModulesPlugin" ) ;
2020-08-28 07:25:34 +08:00
} ,
get JavascriptParser ( ) {
return require ( "./javascript/JavascriptParser" ) ;
2020-03-21 21:01:38 +08:00
}
} ,
2019-10-22 15:09:28 +08:00
2020-03-21 21:01:38 +08:00
optimize : {
get AggressiveMergingPlugin ( ) {
return require ( "./optimize/AggressiveMergingPlugin" ) ;
} ,
get AggressiveSplittingPlugin ( ) {
return util . deprecate (
( ) => require ( "./optimize/AggressiveSplittingPlugin" ) ,
"AggressiveSplittingPlugin is deprecated in favor of SplitChunksPlugin" ,
"DEP_WEBPACK_AGGRESSIVE_SPLITTING_PLUGIN"
) ( ) ;
} ,
2021-09-20 18:26:18 +08:00
get InnerGraph ( ) {
return require ( "./optimize/InnerGraph" ) ;
} ,
2020-03-21 21:01:38 +08:00
get LimitChunkCountPlugin ( ) {
return require ( "./optimize/LimitChunkCountPlugin" ) ;
} ,
2024-11-13 00:42:30 +08:00
get MergeDuplicateChunksPlugin ( ) {
2025-07-02 20:10:54 +08:00
return require ( "./optimize/MergeDuplicateChunksPlugin" ) ;
2024-11-13 00:42:30 +08:00
} ,
2020-03-21 21:01:38 +08:00
get MinChunkSizePlugin ( ) {
return require ( "./optimize/MinChunkSizePlugin" ) ;
} ,
get ModuleConcatenationPlugin ( ) {
return require ( "./optimize/ModuleConcatenationPlugin" ) ;
} ,
2020-11-09 18:58:18 +08:00
get RealContentHashPlugin ( ) {
return require ( "./optimize/RealContentHashPlugin" ) ;
} ,
2020-03-21 21:01:38 +08:00
get RuntimeChunkPlugin ( ) {
return require ( "./optimize/RuntimeChunkPlugin" ) ;
} ,
get SideEffectsFlagPlugin ( ) {
return require ( "./optimize/SideEffectsFlagPlugin" ) ;
} ,
get SplitChunksPlugin ( ) {
return require ( "./optimize/SplitChunksPlugin" ) ;
}
} ,
2018-12-09 21:26:35 +08:00
2020-08-19 21:05:49 +08:00
runtime : {
2020-09-25 02:29:08 +08:00
get GetChunkFilenameRuntimeModule ( ) {
return require ( "./runtime/GetChunkFilenameRuntimeModule" ) ;
} ,
2020-08-19 21:05:49 +08:00
get LoadScriptRuntimeModule ( ) {
return require ( "./runtime/LoadScriptRuntimeModule" ) ;
}
} ,
2020-08-20 05:17:33 +08:00
prefetch : {
get ChunkPrefetchPreloadPlugin ( ) {
return require ( "./prefetch/ChunkPrefetchPreloadPlugin" ) ;
}
} ,
2020-03-21 21:01:38 +08:00
web : {
get FetchCompileWasmPlugin ( ) {
return require ( "./web/FetchCompileWasmPlugin" ) ;
} ,
2024-11-14 11:17:57 +08:00
get FetchCompileAsyncWasmPlugin ( ) {
return require ( "./web/FetchCompileAsyncWasmPlugin" ) ;
} ,
2020-08-25 19:20:29 +08:00
get JsonpChunkLoadingRuntimeModule ( ) {
return require ( "./web/JsonpChunkLoadingRuntimeModule" ) ;
} ,
2020-03-21 21:01:38 +08:00
get JsonpTemplatePlugin ( ) {
return require ( "./web/JsonpTemplatePlugin" ) ;
2024-10-31 22:55:49 +08:00
} ,
get CssLoadingRuntimeModule ( ) {
return require ( "./css/CssLoadingRuntimeModule" ) ;
}
} ,
esm : {
get ModuleChunkLoadingRuntimeModule ( ) {
return require ( "./esm/ModuleChunkLoadingRuntimeModule" ) ;
2020-03-21 21:01:38 +08:00
}
} ,
2018-12-09 21:26:35 +08:00
2020-03-21 21:01:38 +08:00
webworker : {
get WebWorkerTemplatePlugin ( ) {
return require ( "./webworker/WebWorkerTemplatePlugin" ) ;
}
} ,
2018-12-09 21:26:35 +08:00
2020-03-21 21:01:38 +08:00
node : {
get NodeEnvironmentPlugin ( ) {
return require ( "./node/NodeEnvironmentPlugin" ) ;
} ,
2020-08-20 05:17:33 +08:00
get NodeSourcePlugin ( ) {
return require ( "./node/NodeSourcePlugin" ) ;
} ,
get NodeTargetPlugin ( ) {
return require ( "./node/NodeTargetPlugin" ) ;
} ,
2020-03-21 21:01:38 +08:00
get NodeTemplatePlugin ( ) {
return require ( "./node/NodeTemplatePlugin" ) ;
} ,
get ReadFileCompileWasmPlugin ( ) {
return require ( "./node/ReadFileCompileWasmPlugin" ) ;
2024-11-14 11:17:57 +08:00
} ,
get ReadFileCompileAsyncWasmPlugin ( ) {
return require ( "./node/ReadFileCompileAsyncWasmPlugin" ) ;
2020-03-21 21:01:38 +08:00
}
} ,
2018-12-09 21:26:35 +08:00
2020-08-20 05:17:33 +08:00
electron : {
get ElectronTargetPlugin ( ) {
return require ( "./electron/ElectronTargetPlugin" ) ;
}
} ,
2020-03-21 21:01:38 +08:00
wasm : {
get AsyncWebAssemblyModulesPlugin ( ) {
return require ( "./wasm-async/AsyncWebAssemblyModulesPlugin" ) ;
2022-08-31 07:05:43 +08:00
} ,
get EnableWasmLoadingPlugin ( ) {
return require ( "./wasm/EnableWasmLoadingPlugin" ) ;
2020-03-21 21:01:38 +08:00
}
} ,
2019-10-09 19:50:52 +08:00
2024-10-31 22:55:49 +08:00
css : {
get CssModulesPlugin ( ) {
return require ( "./css/CssModulesPlugin" ) ;
}
} ,
2020-03-21 21:01:38 +08:00
library : {
get AbstractLibraryPlugin ( ) {
return require ( "./library/AbstractLibraryPlugin" ) ;
} ,
get EnableLibraryPlugin ( ) {
return require ( "./library/EnableLibraryPlugin" ) ;
}
} ,
2020-02-20 03:25:49 +08:00
2020-04-22 18:09:11 +08:00
container : {
get ContainerPlugin ( ) {
return require ( "./container/ContainerPlugin" ) ;
} ,
get ContainerReferencePlugin ( ) {
return require ( "./container/ContainerReferencePlugin" ) ;
} ,
get ModuleFederationPlugin ( ) {
return require ( "./container/ModuleFederationPlugin" ) ;
} ,
2020-05-14 21:50:35 +08:00
get scope ( ) {
return require ( "./container/options" ) . scope ;
2020-04-22 18:09:11 +08:00
}
} ,
2020-05-23 22:08:51 +08:00
sharing : {
2020-05-26 05:14:19 +08:00
get ConsumeSharedPlugin ( ) {
return require ( "./sharing/ConsumeSharedPlugin" ) ;
} ,
2020-05-23 22:08:51 +08:00
get ProvideSharedPlugin ( ) {
return require ( "./sharing/ProvideSharedPlugin" ) ;
} ,
2020-05-26 06:46:09 +08:00
get SharePlugin ( ) {
return require ( "./sharing/SharePlugin" ) ;
} ,
2020-05-23 22:08:51 +08:00
get scope ( ) {
return require ( "./container/options" ) . scope ;
}
} ,
2020-03-21 21:01:38 +08:00
debug : {
get ProfilingPlugin ( ) {
return require ( "./debug/ProfilingPlugin" ) ;
}
} ,
2018-12-09 21:26:35 +08:00
2020-03-21 21:01:38 +08:00
util : {
get createHash ( ) {
return require ( "./util/createHash" ) ;
} ,
get comparators ( ) {
return require ( "./util/comparators" ) ;
} ,
2021-09-20 18:26:18 +08:00
get runtime ( ) {
return require ( "./util/runtime" ) ;
} ,
2020-03-21 21:01:38 +08:00
get serialization ( ) {
return require ( "./util/serialization" ) ;
2020-10-13 02:16:58 +08:00
} ,
get cleverMerge ( ) {
return require ( "./util/cleverMerge" ) . cachedCleverMerge ;
2021-01-07 20:06:44 +08:00
} ,
get LazySet ( ) {
return require ( "./util/LazySet" ) ;
2024-04-16 23:53:21 +08:00
} ,
get compileBooleanMatcher ( ) {
return require ( "./util/compileBooleanMatcher" ) ;
2020-03-21 21:01:38 +08:00
}
2020-07-03 20:45:49 +08:00
} ,
2020-08-20 02:05:47 +08:00
get sources ( ) {
return require ( "webpack-sources" ) ;
} ,
2020-07-03 20:45:49 +08:00
experiments : {
schemes : {
get HttpUriPlugin ( ) {
return require ( "./schemes/HttpUriPlugin" ) ;
2025-05-22 22:41:15 +08:00
} ,
get VirtualUrlPlugin ( ) {
return require ( "./schemes/VirtualUrlPlugin" ) ;
2020-07-03 20:45:49 +08:00
}
2022-01-19 21:21:10 +08:00
} ,
ids : {
get SyncModuleIdsPlugin ( ) {
return require ( "./ids/SyncModuleIdsPlugin" ) ;
}
2020-07-03 20:45:49 +08:00
}
2020-03-21 21:01:38 +08:00
}
2018-12-09 21:26:35 +08:00
} ) ;