From ef60be646621ec8528d7ef00abd3078f304a44b4 Mon Sep 17 00:00:00 2001 From: Aditya Raj Date: Sat, 14 Mar 2026 14:20:20 +0530 Subject: [PATCH 1/3] feat: render constructors in Node.js API style (new ClassName) --- pages/v5.x/globals.md | 130 +++++++++--------- pages/v5.x/webpack/namespaces/cache.md | 2 +- pages/v5.x/webpack/namespaces/container.md | 6 +- pages/v5.x/webpack/namespaces/css.md | 2 +- pages/v5.x/webpack/namespaces/debug.md | 2 +- pages/v5.x/webpack/namespaces/dependencies.md | 8 +- pages/v5.x/webpack/namespaces/electron.md | 2 +- pages/v5.x/webpack/namespaces/esm.md | 2 +- .../namespaces/experiments/namespaces/ids.md | 2 +- .../experiments/namespaces/schemes.md | 4 +- pages/v5.x/webpack/namespaces/ids.md | 18 +-- pages/v5.x/webpack/namespaces/javascript.md | 4 +- pages/v5.x/webpack/namespaces/library.md | 4 +- pages/v5.x/webpack/namespaces/node.md | 12 +- .../v5.x/webpack/namespaces/optimize/index.md | 20 +-- .../optimize/namespaces/InnerGraph.md | 2 +- pages/v5.x/webpack/namespaces/prefetch.md | 2 +- pages/v5.x/webpack/namespaces/runtime.md | 4 +- pages/v5.x/webpack/namespaces/sharing.md | 6 +- pages/v5.x/webpack/namespaces/sources.md | 20 +-- pages/v5.x/webpack/namespaces/util/index.md | 2 +- .../namespaces/util/namespaces/runtime.md | 4 +- pages/v5.x/webpack/namespaces/wasm.md | 4 +- pages/v5.x/webpack/namespaces/web.md | 10 +- pages/v5.x/webpack/namespaces/webworker.md | 2 +- plugins/theme/partials/index.mjs | 25 +++- 26 files changed, 161 insertions(+), 138 deletions(-) diff --git a/pages/v5.x/globals.md b/pages/v5.x/globals.md index a172e92..9f55590 100644 --- a/pages/v5.x/globals.md +++ b/pages/v5.x/globals.md @@ -37,7 +37,7 @@ ### Constructors -#### Constructor +#### `new AsyncDependenciesBlock(groupOptions[, loc][, request])` * `groupOptions` {string|GroupOptionsAsyncDependenciesBlock} * `loc` {SyntheticDependencyLocation|RealDependencyLocation} @@ -108,7 +108,7 @@ Removes all dependencies and blocks ### Constructors -#### Constructor +#### `new AutomaticPrefetchPlugin()` * Returns: {AutomaticPrefetchPlugin} @@ -127,7 +127,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new BannerPlugin(options)` * `options` {BannerPluginArgument} * Returns: {BannerPlugin} @@ -152,7 +152,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Cache()` * Returns: {CacheClass} @@ -219,7 +219,7 @@ After this method has succeeded the cache can only be restored when build depend ### Constructors -#### Constructor +#### `new Chunk([name][, backCompat])` * `name` {string} * `backCompat` {boolean} @@ -442,7 +442,7 @@ After this method has succeeded the cache can only be restored when build depend ### Constructors -#### Constructor +#### `new ChunkGraph(moduleGraph[, hashFunction])` * `moduleGraph` {ModuleGraph} * `hashFunction` {HashFunction} @@ -971,7 +971,7 @@ After this method has succeeded the cache can only be restored when build depend ### Constructors -#### Constructor +#### `new ChunkGroup()` * Returns: {ChunkGroup} @@ -1177,7 +1177,7 @@ Performs an unshift of a specific chunk ### Constructors -#### Constructor +#### `new CleanPlugin([options])` * `options` {CleanOptions} * Returns: {CleanPlugin} @@ -1206,7 +1206,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new CodeGenerationResults()` * Returns: {CodeGenerationResults} @@ -1267,7 +1267,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Compilation(compiler, params)` * `compiler` {Compiler} * `params` {CompilationParams} @@ -1725,7 +1725,7 @@ Fetches a module from a compilation by its identifier ### Constructors -#### Constructor +#### `new Compiler(context[, options])` * `context` {string} * `options` {WebpackOptionsNormalized} @@ -1880,7 +1880,7 @@ Schema validation function with optional pre-compiled check ### Constructors -#### Constructor +#### `new ConcatenationScope(modulesMap, currentModule, usedNames)` * `modulesMap` {ModuleInfo[]|Map} * `currentModule` {ConcatenatedModuleInfo} @@ -1950,7 +1950,7 @@ Schema validation function with optional pre-compiled check ### Constructors -#### Constructor +#### `new ContextExclusionPlugin(negativeMatcher)` * `negativeMatcher` {RegExp} * Returns: {ContextExclusionPlugin} @@ -1974,7 +1974,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ContextReplacementPlugin(resourceRegExp[, newContentResource][, newContentRecursive][, newContentRegExp])` * `resourceRegExp` {RegExp} * `newContentResource` {string|boolean|RegExp|object} @@ -2006,7 +2006,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new DefinePlugin(definitions)` * `definitions` {Definitions} * Returns: {DefinePlugin} @@ -2043,7 +2043,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new DelegatedPlugin(options)` * `options` {Options} * Returns: {DelegatedPlugin} @@ -2072,7 +2072,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Dependency()` * Returns: {Dependency} @@ -2199,7 +2199,7 @@ Update the hash ### Constructors -#### Constructor +#### `new DllPlugin(options)` * `options` {DllPluginOptions} * Returns: {DllPlugin} @@ -2223,7 +2223,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new DllReferencePlugin(options)` * `options` {DllReferencePluginOptions} * Returns: {DllReferencePlugin} @@ -2247,7 +2247,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new DotenvPlugin([options])` * `options` {DotenvPluginOptions} * Returns: {DotenvPlugin} @@ -2269,7 +2269,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new DynamicEntryPlugin(context, entry)` * `context` {string} * `entry` {object} @@ -2295,7 +2295,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new EntryOptionPlugin()` * Returns: {EntryOptionPlugin} @@ -2326,7 +2326,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new EntryPlugin(context, entry[, options])` * `context` {string} * `entry` {string} @@ -2366,7 +2366,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Entrypoint()` * Returns: {Entrypoint} @@ -2609,7 +2609,7 @@ Performs an unshift of a specific chunk ### Constructors -#### Constructor +#### `new EnvironmentPlugin(keys)` * `keys` {string|string[]|Record[]} * Returns: {EnvironmentPlugin} @@ -2634,7 +2634,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new EvalDevToolModulePlugin([options])` * `options` {EvalDevToolModulePluginOptions} * Returns: {EvalDevToolModulePlugin} @@ -2660,7 +2660,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new EvalSourceMapDevToolPlugin([inputOptions])` * `inputOptions` {string|SourceMapDevToolPluginOptions} * Returns: {EvalSourceMapDevToolPlugin} @@ -2691,7 +2691,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ExternalModule(request, type, userRequest[, dependencyMeta])` * `request` {ExternalModuleRequest} * `type` {ExternalsType} @@ -3061,7 +3061,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new ExternalsPlugin(type, externals)` * `type` {"asset"|"module"|"css-import"|"css-url"|"global"|"import"|"commonjs"|"jsonp"|"promise"|"this"|"var"|"assign"|"window"|"self"|"commonjs2"|"commonjs-module"|"commonjs-static"|"amd"|"amd-require"|"umd"|"umd2"|"system"|"module-import"|"script"|"node-commonjs"|object} * `externals` {Externals} @@ -3087,7 +3087,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Generator()` * Returns: {Generator} @@ -3133,7 +3133,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new HotModuleReplacementPlugin()` * Returns: {HotModuleReplacementPlugin} @@ -3161,7 +3161,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new HotUpdateChunk()` * Returns: {HotUpdateChunk} @@ -3382,7 +3382,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new IgnorePlugin(options)` * `options` {IgnorePluginOptions} * Returns: {IgnorePlugin} @@ -3419,7 +3419,7 @@ Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextReg ### Constructors -#### Constructor +#### `new InitFragment(content, stage, position[, key][, endContent])` ###### GenerateContext @@ -3484,7 +3484,7 @@ Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextReg ### Constructors -#### Constructor +#### `new JavascriptModulesPlugin([options])` * `options` {object} * Returns: {JavascriptModulesPlugin} @@ -3559,7 +3559,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new LibManifestPlugin(options)` * `options` {LibManifestPluginOptions} * Returns: {LibManifestPlugin} @@ -3583,7 +3583,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new LibraryTemplatePlugin(name, target, umdNamedDefine, auxiliaryComment, exportProperty)` * `name` {LibraryName} * `target` {string} @@ -3611,7 +3611,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new LoaderOptionsPlugin([options])` * `options` {LoaderOptionsPluginOptions|MatchObject} * Returns: {LoaderOptionsPlugin} @@ -3635,7 +3635,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new LoaderTargetPlugin(target)` * `target` {string} * Returns: {LoaderTargetPlugin} @@ -3659,7 +3659,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ManifestPlugin([options])` * `options` {ManifestPluginOptions} * Returns: {ManifestPlugin} @@ -3693,7 +3693,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Module(type[, context][, layer])` * `type` {string} * `context` {string} @@ -4048,7 +4048,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new ModuleFactory()` * Returns: {ModuleFactory} @@ -4066,7 +4066,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new ModuleGraph()` * Returns: {ModuleGraph} @@ -4437,7 +4437,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new ModuleGraphConnection(originModule, dependency, module[, explanation][, weak][, condition])` * `originModule` {Module} * `dependency` {Dependency} @@ -4505,7 +4505,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new MultiCompiler(compilers, options)` * `compilers` {Compiler[]|Record} * `options` {MultiCompilerOptions} @@ -4579,7 +4579,7 @@ This method should have been private ### Constructors -#### Constructor +#### `new MultiStats()` * Returns: {MultiStats} @@ -4614,7 +4614,7 @@ This method should have been private ### Constructors -#### Constructor +#### `new NoEmitOnErrorsPlugin()` * Returns: {NoEmitOnErrorsPlugin} @@ -4637,7 +4637,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new NormalModule(__namedParameters)` * `__namedParameters` {NormalModuleCreateData} * Returns: {NormalModule} @@ -5066,7 +5066,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new NormalModuleReplacementPlugin(resourceRegExp, newResource)` * `resourceRegExp` {RegExp} * `newResource` {string|object} @@ -5098,7 +5098,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Parser()` * Returns: {ParserClass} @@ -5116,7 +5116,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new PlatformPlugin(platform)` * `platform` {Partial} * Returns: {PlatformPlugin} @@ -5140,7 +5140,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new PrefetchPlugin(context[, request])` * `context` {string} * `request` {string} @@ -5166,7 +5166,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ProgressPlugin([options])` * `options` {ProgressPluginArgument} * Returns: {ProgressPlugin} @@ -5204,7 +5204,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ProvidePlugin(definitions)` * `definitions` {Record} * Returns: {ProvidePlugin} @@ -5228,7 +5228,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Resolver()` * Returns: {Resolver} @@ -5323,7 +5323,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new RuntimeModule(name[, stage])` * `name` {string} * `stage` {number} @@ -5707,7 +5707,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new SourceMapDevToolPlugin([options])` * `options` {SourceMapDevToolPluginOptions} * Returns: {SourceMapDevToolPlugin} @@ -5736,7 +5736,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Stats(compilation)` * `compilation` {Compilation} * Returns: {Stats} @@ -5774,7 +5774,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Template()` * Returns: {Template} @@ -5867,7 +5867,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new WatchIgnorePlugin(options)` * `options` {WatchIgnorePluginOptions} * Returns: {WatchIgnorePlugin} @@ -5891,7 +5891,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new Watching()` * Returns: {Watching} @@ -5952,7 +5952,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new WebpackError([message][, options])` * `message` {string} * `options` {object} @@ -6048,7 +6048,7 @@ a(); ### Constructors -#### Constructor +#### `new WebpackOptionsApply()` * Returns: {WebpackOptionsApply} @@ -6067,7 +6067,7 @@ a(); ### Constructors -#### Constructor +#### `new WebpackOptionsDefaulter()` * Returns: {WebpackOptionsDefaulter} @@ -6088,7 +6088,7 @@ a(); ### Constructors -#### Constructor +#### `new WebpackOptionsValidationError(errors, schema[, configuration])` * `errors` {SchemaUtilErrorObject[]} array of error objects * `schema` {Schema} schema diff --git a/pages/v5.x/webpack/namespaces/cache.md b/pages/v5.x/webpack/namespaces/cache.md index d6041bb..2f38301 100644 --- a/pages/v5.x/webpack/namespaces/cache.md +++ b/pages/v5.x/webpack/namespaces/cache.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new MemoryCachePlugin()` * Returns: {MemoryCachePlugin} diff --git a/pages/v5.x/webpack/namespaces/container.md b/pages/v5.x/webpack/namespaces/container.md index 49c2d51..cc93cee 100644 --- a/pages/v5.x/webpack/namespaces/container.md +++ b/pages/v5.x/webpack/namespaces/container.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new ContainerPlugin(options)` * `options` {ContainerPluginOptions} * Returns: {ContainerPlugin} @@ -28,7 +28,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ContainerReferencePlugin(options)` * `options` {ContainerReferencePluginOptions} * Returns: {ContainerReferencePlugin} @@ -52,7 +52,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ModuleFederationPlugin(options)` * `options` {ModuleFederationPluginOptions} * Returns: {ModuleFederationPlugin} diff --git a/pages/v5.x/webpack/namespaces/css.md b/pages/v5.x/webpack/namespaces/css.md index 5bdf74e..9077049 100644 --- a/pages/v5.x/webpack/namespaces/css.md +++ b/pages/v5.x/webpack/namespaces/css.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new CssModulesPlugin()` * Returns: {CssModulesPlugin} diff --git a/pages/v5.x/webpack/namespaces/debug.md b/pages/v5.x/webpack/namespaces/debug.md index a029817..f19576e 100644 --- a/pages/v5.x/webpack/namespaces/debug.md +++ b/pages/v5.x/webpack/namespaces/debug.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new ProfilingPlugin([options])` * `options` {ProfilingPluginOptions} * Returns: {ProfilingPlugin} diff --git a/pages/v5.x/webpack/namespaces/dependencies.md b/pages/v5.x/webpack/namespaces/dependencies.md index c18eeeb..c1d7fc2 100644 --- a/pages/v5.x/webpack/namespaces/dependencies.md +++ b/pages/v5.x/webpack/namespaces/dependencies.md @@ -8,7 +8,7 @@ ### Constructors -#### Constructor +#### `new ConstDependency(expression, range[, runtimeRequirements])` * `expression` {string} * `range` {number|number|number} @@ -146,7 +146,7 @@ Update the hash ### Constructors -#### Constructor +#### `new HarmonyImportDependency(request, sourceOrder[, phase][, attributes])` * `request` {string} * `sourceOrder` {number} @@ -317,7 +317,7 @@ Update the hash ### Constructors -#### Constructor +#### `new ModuleDependency(request[, sourceOrder])` * `request` {string} * `sourceOrder` {number} @@ -459,7 +459,7 @@ Update the hash ### Constructors -#### Constructor +#### `new NullDependency()` * Returns: {NullDependency} diff --git a/pages/v5.x/webpack/namespaces/electron.md b/pages/v5.x/webpack/namespaces/electron.md index 2fd9990..c187fe5 100644 --- a/pages/v5.x/webpack/namespaces/electron.md +++ b/pages/v5.x/webpack/namespaces/electron.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new ElectronTargetPlugin([context])` * `context` {"main"|"preload"|"renderer"} * Returns: {ElectronTargetPlugin} diff --git a/pages/v5.x/webpack/namespaces/esm.md b/pages/v5.x/webpack/namespaces/esm.md index c51a34d..4423cb9 100644 --- a/pages/v5.x/webpack/namespaces/esm.md +++ b/pages/v5.x/webpack/namespaces/esm.md @@ -8,7 +8,7 @@ ### Constructors -#### Constructor +#### `new ModuleChunkLoadingRuntimeModule(runtimeRequirements)` * `runtimeRequirements` {ReadonlySet} * Returns: {ModuleChunkLoadingRuntimeModule} diff --git a/pages/v5.x/webpack/namespaces/experiments/namespaces/ids.md b/pages/v5.x/webpack/namespaces/experiments/namespaces/ids.md index 3ff79f4..dcf8042 100644 --- a/pages/v5.x/webpack/namespaces/experiments/namespaces/ids.md +++ b/pages/v5.x/webpack/namespaces/experiments/namespaces/ids.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new SyncModuleIdsPlugin(options)` * `options` {SyncModuleIdsPluginOptions} * Returns: {SyncModuleIdsPlugin} diff --git a/pages/v5.x/webpack/namespaces/experiments/namespaces/schemes.md b/pages/v5.x/webpack/namespaces/experiments/namespaces/schemes.md index 4ed6a96..e69dd79 100644 --- a/pages/v5.x/webpack/namespaces/experiments/namespaces/schemes.md +++ b/pages/v5.x/webpack/namespaces/experiments/namespaces/schemes.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new HttpUriPlugin(options)` * `options` {HttpUriOptions} * Returns: {HttpUriPlugin} @@ -28,7 +28,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new VirtualUrlPlugin(modules[, schemeOrOptions])` * `modules` {VirtualModules} * `schemeOrOptions` {string|Omit} diff --git a/pages/v5.x/webpack/namespaces/ids.md b/pages/v5.x/webpack/namespaces/ids.md index cdaae00..2954fa1 100644 --- a/pages/v5.x/webpack/namespaces/ids.md +++ b/pages/v5.x/webpack/namespaces/ids.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new ChunkModuleIdRangePlugin(options)` * `options` {ChunkModuleIdRangePluginOptions} * Returns: {ChunkModuleIdRangePlugin} @@ -28,7 +28,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new DeterministicChunkIdsPlugin([options])` * `options` {DeterministicChunkIdsPluginOptions} * Returns: {DeterministicChunkIdsPlugin} @@ -52,7 +52,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new DeterministicModuleIdsPlugin([options])` * `options` {DeterministicModuleIdsPluginOptions} * Returns: {DeterministicModuleIdsPlugin} @@ -76,7 +76,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new HashedModuleIdsPlugin([options])` * `options` {HashedModuleIdsPluginOptions} * Returns: {HashedModuleIdsPlugin} @@ -100,7 +100,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new NamedChunkIdsPlugin([options])` * `options` {NamedChunkIdsPluginOptions} * Returns: {NamedChunkIdsPlugin} @@ -124,7 +124,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new NamedModuleIdsPlugin([options])` * `options` {NamedModuleIdsPluginOptions} * Returns: {NamedModuleIdsPlugin} @@ -148,7 +148,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new NaturalModuleIdsPlugin()` * Returns: {NaturalModuleIdsPlugin} @@ -167,7 +167,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new OccurrenceChunkIdsPlugin([options])` * `options` {OccurrenceChunkIdsPluginOptions} * Returns: {OccurrenceChunkIdsPlugin} @@ -191,7 +191,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new OccurrenceModuleIdsPlugin([options])` * `options` {OccurrenceModuleIdsPluginOptions} * Returns: {OccurrenceModuleIdsPlugin} diff --git a/pages/v5.x/webpack/namespaces/javascript.md b/pages/v5.x/webpack/namespaces/javascript.md index 9d02516..8500749 100644 --- a/pages/v5.x/webpack/namespaces/javascript.md +++ b/pages/v5.x/webpack/namespaces/javascript.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new EnableChunkLoadingPlugin(type)` * `type` {string} * Returns: {EnableChunkLoadingPlugin} @@ -44,7 +44,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new JavascriptParser([sourceType][, options])` * `sourceType` {"module"|"auto"|"script"} * `options` {object} diff --git a/pages/v5.x/webpack/namespaces/library.md b/pages/v5.x/webpack/namespaces/library.md index 759271b..25a5f90 100644 --- a/pages/v5.x/webpack/namespaces/library.md +++ b/pages/v5.x/webpack/namespaces/library.md @@ -10,7 +10,7 @@ ### Constructors -#### Constructor +#### `new AbstractLibraryPlugin(__namedParameters)` ###### T @@ -100,7 +100,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new EnableLibraryPlugin(type[, options])` * `type` {string} * `options` {EnableLibraryPluginOptions} diff --git a/pages/v5.x/webpack/namespaces/node.md b/pages/v5.x/webpack/namespaces/node.md index ad4e732..1ced809 100644 --- a/pages/v5.x/webpack/namespaces/node.md +++ b/pages/v5.x/webpack/namespaces/node.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new NodeEnvironmentPlugin(options)` * `options` {NodeEnvironmentPluginOptions} * Returns: {NodeEnvironmentPlugin} @@ -28,7 +28,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new NodeSourcePlugin()` * Returns: {NodeSourcePlugin} @@ -47,7 +47,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new NodeTargetPlugin([type])` * `type` {ExternalsType} * Returns: {NodeTargetPlugin} @@ -71,7 +71,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new NodeTemplatePlugin([options])` * `options` {NodeTemplatePluginOptions} * Returns: {NodeTemplatePlugin} @@ -91,7 +91,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ReadFileCompileAsyncWasmPlugin([__namedParameters])` * `__namedParameters` {ReadFileCompileAsyncWasmPluginOptions} * Returns: {ReadFileCompileAsyncWasmPlugin} @@ -111,7 +111,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ReadFileCompileWasmPlugin([options])` * `options` {ReadFileCompileWasmPluginOptions} * Returns: {ReadFileCompileWasmPlugin} diff --git a/pages/v5.x/webpack/namespaces/optimize/index.md b/pages/v5.x/webpack/namespaces/optimize/index.md index d98d760..8e99d60 100644 --- a/pages/v5.x/webpack/namespaces/optimize/index.md +++ b/pages/v5.x/webpack/namespaces/optimize/index.md @@ -8,7 +8,7 @@ ### Constructors -#### Constructor +#### `new AggressiveMergingPlugin([options])` * `options` {AggressiveMergingPluginOptions} * Returns: {AggressiveMergingPlugin} @@ -32,7 +32,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new AggressiveSplittingPlugin([options])` * `options` {AggressiveSplittingPluginOptions} * Returns: {AggressiveSplittingPlugin} @@ -61,7 +61,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new LimitChunkCountPlugin([options])` * `options` {LimitChunkCountPluginOptions} * Returns: {LimitChunkCountPlugin} @@ -83,7 +83,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new MergeDuplicateChunksPlugin([options])` * `options` {MergeDuplicateChunksPluginOptions} * Returns: {MergeDuplicateChunksPlugin} @@ -105,7 +105,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new MinChunkSizePlugin(options)` * `options` {MinChunkSizePluginOptions} * Returns: {MinChunkSizePlugin} @@ -129,7 +129,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ModuleConcatenationPlugin()` * Returns: {ModuleConcatenationPlugin} @@ -148,7 +148,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new RealContentHashPlugin(__namedParameters)` * `__namedParameters` {RealContentHashPluginOptions} * Returns: {RealContentHashPlugin} @@ -173,7 +173,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new RuntimeChunkPlugin([options])` * `options` {object} * Returns: {RuntimeChunkPlugin} @@ -197,7 +197,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new SideEffectsFlagPlugin([analyseSource])` * `analyseSource` {boolean} * Returns: {SideEffectsFlagPlugin} @@ -224,7 +224,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new SplitChunksPlugin([options])` * `options` {OptimizationSplitChunksOptions} * Returns: {SplitChunksPlugin} diff --git a/pages/v5.x/webpack/namespaces/optimize/namespaces/InnerGraph.md b/pages/v5.x/webpack/namespaces/optimize/namespaces/InnerGraph.md index c241519..fb37d0d 100644 --- a/pages/v5.x/webpack/namespaces/optimize/namespaces/InnerGraph.md +++ b/pages/v5.x/webpack/namespaces/optimize/namespaces/InnerGraph.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new TopLevelSymbol(name)` * `name` {string} * Returns: {TopLevelSymbol} diff --git a/pages/v5.x/webpack/namespaces/prefetch.md b/pages/v5.x/webpack/namespaces/prefetch.md index 429bbf3..afe6108 100644 --- a/pages/v5.x/webpack/namespaces/prefetch.md +++ b/pages/v5.x/webpack/namespaces/prefetch.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new ChunkPrefetchPreloadPlugin()` * Returns: {ChunkPrefetchPreloadPlugin} diff --git a/pages/v5.x/webpack/namespaces/runtime.md b/pages/v5.x/webpack/namespaces/runtime.md index 21897de..db01c97 100644 --- a/pages/v5.x/webpack/namespaces/runtime.md +++ b/pages/v5.x/webpack/namespaces/runtime.md @@ -8,7 +8,7 @@ ### Constructors -#### Constructor +#### `new GetChunkFilenameRuntimeModule(contentType, name, global, getFilenameForChunk, allChunks)` * `contentType` {string} * `name` {string} @@ -403,7 +403,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new LoadScriptRuntimeModule([withCreateScriptUrl][, withFetchPriority])` * `withCreateScriptUrl` {boolean} * `withFetchPriority` {boolean} diff --git a/pages/v5.x/webpack/namespaces/sharing.md b/pages/v5.x/webpack/namespaces/sharing.md index 8d8b8a7..93a97fc 100644 --- a/pages/v5.x/webpack/namespaces/sharing.md +++ b/pages/v5.x/webpack/namespaces/sharing.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new ConsumeSharedPlugin(options)` * `options` {ConsumeSharedPluginOptions} * Returns: {ConsumeSharedPlugin} @@ -28,7 +28,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new ProvideSharedPlugin(options)` * `options` {ProvideSharedPluginOptions} * Returns: {ProvideSharedPlugin} @@ -52,7 +52,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new SharePlugin(options)` * `options` {SharePluginOptions} * Returns: {SharePlugin} diff --git a/pages/v5.x/webpack/namespaces/sources.md b/pages/v5.x/webpack/namespaces/sources.md index f5eed32..13b3024 100644 --- a/pages/v5.x/webpack/namespaces/sources.md +++ b/pages/v5.x/webpack/namespaces/sources.md @@ -8,7 +8,7 @@ ### Constructors -#### Constructor +#### `new CachedSource(source[, cachedData])` * `source` {Source|object} * `cachedData` {CachedData} @@ -73,7 +73,7 @@ ### Constructors -#### Constructor +#### `new CompatSource(sourceLike)` * `sourceLike` {SourceLike} * Returns: {CompatSource} @@ -122,7 +122,7 @@ ### Constructors -#### Constructor +#### `new ConcatSource(args)` * `args` {ConcatSourceChild[]} * Returns: {ConcatSource} @@ -188,7 +188,7 @@ ### Constructors -#### Constructor +#### `new OriginalSource(value, name)` * `value` {string|Buffer} * `name` {string} @@ -245,7 +245,7 @@ ### Constructors -#### Constructor +#### `new PrefixSource(prefix, source)` * `prefix` {string} * `source` {string|Buffer|Source} @@ -306,7 +306,7 @@ ### Constructors -#### Constructor +#### `new RawSource(value[, convertToString])` * `value` {string|Buffer} * `convertToString` {boolean} @@ -363,7 +363,7 @@ ### Constructors -#### Constructor +#### `new ReplaceSource(source[, name])` * `source` {Source} * `name` {string} @@ -447,7 +447,7 @@ ### Constructors -#### Constructor +#### `new SizeOnlySource(size)` * `size` {number} * Returns: {SizeOnlySource} @@ -499,7 +499,7 @@ ### Constructors -#### Constructor +#### `new Source()` * Returns: {Source} @@ -542,7 +542,7 @@ ### Constructors -#### Constructor +#### `new SourceMapSource(value, name[, sourceMap][, originalSource][, innerSourceMap][, removeOriginalSource])` * `value` {string|Buffer} * `name` {string} diff --git a/pages/v5.x/webpack/namespaces/util/index.md b/pages/v5.x/webpack/namespaces/util/index.md index c514633..38bc68a 100644 --- a/pages/v5.x/webpack/namespaces/util/index.md +++ b/pages/v5.x/webpack/namespaces/util/index.md @@ -17,7 +17,7 @@ ### Constructors -#### Constructor +#### `new LazySet([iterable])` ###### T diff --git a/pages/v5.x/webpack/namespaces/util/namespaces/runtime.md b/pages/v5.x/webpack/namespaces/util/namespaces/runtime.md index 5adf253..e656b97 100644 --- a/pages/v5.x/webpack/namespaces/util/namespaces/runtime.md +++ b/pages/v5.x/webpack/namespaces/util/namespaces/runtime.md @@ -14,7 +14,7 @@ ### Constructors -#### Constructor +#### `new RuntimeSpecMap([clone])` ###### T @@ -79,7 +79,7 @@ ### Constructors -#### Constructor +#### `new RuntimeSpecSet([iterable])` * `iterable` {Iterable} * Returns: {RuntimeSpecSet} diff --git a/pages/v5.x/webpack/namespaces/wasm.md b/pages/v5.x/webpack/namespaces/wasm.md index 6b2e34b..503c231 100644 --- a/pages/v5.x/webpack/namespaces/wasm.md +++ b/pages/v5.x/webpack/namespaces/wasm.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new AsyncWebAssemblyModulesPlugin(options)` * `options` {AsyncWebAssemblyModulesPluginOptions} * Returns: {AsyncWebAssemblyModulesPlugin} @@ -40,7 +40,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new EnableWasmLoadingPlugin(type)` * `type` {string} * Returns: {EnableWasmLoadingPlugin} diff --git a/pages/v5.x/webpack/namespaces/web.md b/pages/v5.x/webpack/namespaces/web.md index 57fe02f..eb5fa3a 100644 --- a/pages/v5.x/webpack/namespaces/web.md +++ b/pages/v5.x/webpack/namespaces/web.md @@ -8,7 +8,7 @@ ### Constructors -#### Constructor +#### `new CssLoadingRuntimeModule(runtimeRequirements)` * `runtimeRequirements` {ReadonlySet} * Returns: {CssLoadingRuntimeModule} @@ -396,7 +396,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new FetchCompileAsyncWasmPlugin()` * Returns: {FetchCompileAsyncWasmPlugin} @@ -415,7 +415,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new FetchCompileWasmPlugin([options])` * `options` {FetchCompileWasmPluginOptions} * Returns: {FetchCompileWasmPlugin} @@ -443,7 +443,7 @@ Apply the plugin ### Constructors -#### Constructor +#### `new JsonpChunkLoadingRuntimeModule(runtimeRequirements)` * `runtimeRequirements` {ReadonlySet} * Returns: {JsonpChunkLoadingRuntimeModule} @@ -831,7 +831,7 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead ### Constructors -#### Constructor +#### `new JsonpTemplatePlugin()` * Returns: {JsonpTemplatePlugin} diff --git a/pages/v5.x/webpack/namespaces/webworker.md b/pages/v5.x/webpack/namespaces/webworker.md index af2d1ff..3d4c391 100644 --- a/pages/v5.x/webpack/namespaces/webworker.md +++ b/pages/v5.x/webpack/namespaces/webworker.md @@ -4,7 +4,7 @@ ### Constructors -#### Constructor +#### `new WebWorkerTemplatePlugin()` * Returns: {WebWorkerTemplatePlugin} diff --git a/plugins/theme/partials/index.mjs b/plugins/theme/partials/index.mjs index 56463fb..5b33f6a 100644 --- a/plugins/theme/partials/index.mjs +++ b/plugins/theme/partials/index.mjs @@ -7,7 +7,6 @@ const KIND_PREFIX = { [ReflectionKind.Enum]: "Enum", [ReflectionKind.TypeAlias]: "Type", [ReflectionKind.Namespace]: "Namespace", - [ReflectionKind.Constructor]: "Constructor", [ReflectionKind.Accessor]: "Accessor", }; @@ -89,6 +88,30 @@ export default (ctx) => ({ return `${prefix}\`${model.name}(${paramsString})\``; }, + constructor(model, options) { + const md = []; + model.signatures?.forEach((signature) => { + const params = signature.parameters ?? []; + const paramsString = params + .map((param, index) => { + if (param.flags?.isOptional) { + return index === 0 ? `[${param.name}]` : `[, ${param.name}]`; + } + return index === 0 ? param.name : `, ${param.name}`; + }) + .join(""); + + const heading = "#".repeat(options.headingLevel); + md.push(`${heading} \`new ${model.parent.name}(${paramsString})\``); + md.push( + ctx.partials.signature(signature, { + headingLevel: options.headingLevel + 1, + }), + ); + }); + return md.join("\n\n"); + }, + parametersList: ctx.helpers.typedList, typedParametersList: ctx.helpers.typedList, typeDeclarationList: ctx.helpers.typedList, From 9641d31a77471f327325efcb2a62ac2c8cdb691f Mon Sep 17 00:00:00 2001 From: Aditya Raj Date: Sat, 14 Mar 2026 14:26:20 +0530 Subject: [PATCH 2/3] chore: update package-lock.json --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e5eb18..4f4a912 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,7 @@ "requires": true, "packages": { "": { + "name": "webpack-doc-kit", "dependencies": { "@node-core/doc-kit": "^1.0.1", "semver": "^7.7.4", @@ -8236,9 +8237,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz", - "integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==", + "version": "6.24.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", + "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", "license": "MIT", "engines": { "node": ">=18.17" From fb277354cb45a0eccbe0dc12837f0ef05720bd3c Mon Sep 17 00:00:00 2001 From: Aditya Raj Date: Sat, 14 Mar 2026 15:13:45 +0530 Subject: [PATCH 3/3] refactor: extract parameter formatting into internal helper function --- plugins/theme/partials/index.mjs | 39 +++++++++++++++----------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/plugins/theme/partials/index.mjs b/plugins/theme/partials/index.mjs index 5b33f6a..4302688 100644 --- a/plugins/theme/partials/index.mjs +++ b/plugins/theme/partials/index.mjs @@ -14,6 +14,17 @@ const STATIC_PREFIX = { [ReflectionKind.Method]: "Static method", }; +const formatParams = (params = []) => + params + .map((param, index) => { + if (param.flags?.isOptional) { + return index === 0 ? `[${param.name}]` : `[, ${param.name}]`; + } + + return index === 0 ? param.name : `, ${param.name}`; + }) + .join(""); + export const getMemberPrefix = (model) => { const prefix = model.flags?.isStatic ? STATIC_PREFIX[model.kind] @@ -65,6 +76,11 @@ export default (ctx) => ({ }, memberTitle(model) { + if (model.kind === ReflectionKind.Constructor) { + const params = model.signatures?.[0]?.parameters ?? []; + return `\`new ${model.parent.name}(${formatParams(params)})\``; + } + const prefix = getMemberPrefix(model); const params = model.signatures?.[0]?.parameters; @@ -72,18 +88,7 @@ export default (ctx) => ({ return `${prefix}\`${model.name}\``; } - const paramsString = params - .map((param, index) => { - const paramName = param.name; - if (param.flags?.isOptional) { - // For optional params, wrap comma + name in brackets (except for first param) - return index === 0 ? `[${paramName}]` : `[, ${paramName}]`; - } else { - // For required params, add comma separator (except for first param) - return index === 0 ? paramName : `, ${paramName}`; - } - }) - .join(""); + const paramsString = formatParams(params); return `${prefix}\`${model.name}(${paramsString})\``; }, @@ -91,15 +96,7 @@ export default (ctx) => ({ constructor(model, options) { const md = []; model.signatures?.forEach((signature) => { - const params = signature.parameters ?? []; - const paramsString = params - .map((param, index) => { - if (param.flags?.isOptional) { - return index === 0 ? `[${param.name}]` : `[, ${param.name}]`; - } - return index === 0 ? param.name : `, ${param.name}`; - }) - .join(""); + const paramsString = formatParams(signature.parameters ?? []); const heading = "#".repeat(options.headingLevel); md.push(`${heading} \`new ${model.parent.name}(${paramsString})\``);