@umijs/bundler-webpack 3.5.20 → 4.0.0-beta.4
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/README.md +2 -0
- package/bin/bundler-webpack.js +1 -2
- package/client/client/client.js +202 -0
- package/client/constants.js +12 -0
- package/client/utils/formatWebpackMessages.js +92 -0
- package/compiled/@svgr/webpack/.svgo.yml +75 -0
- package/compiled/@svgr/webpack/LICENSE +7 -0
- package/compiled/@svgr/webpack/index.js +343 -0
- package/compiled/@svgr/webpack/package.json +1 -0
- package/compiled/autoprefixer/LICENSE +20 -0
- package/compiled/autoprefixer/browserslist/index.d.ts +172 -0
- package/compiled/autoprefixer/index.js +9 -0
- package/compiled/autoprefixer/lib/autoprefixer.d.ts +95 -0
- package/compiled/autoprefixer/package.json +1 -0
- package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +106 -0
- package/compiled/autoprefixer/postcss/lib/comment.d.ts +56 -0
- package/compiled/autoprefixer/postcss/lib/container.d.ts +442 -0
- package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +192 -0
- package/compiled/autoprefixer/postcss/lib/declaration.d.ts +124 -0
- package/compiled/autoprefixer/postcss/lib/document.d.ts +57 -0
- package/compiled/autoprefixer/postcss/lib/input.d.ts +130 -0
- package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +175 -0
- package/compiled/autoprefixer/postcss/lib/list.d.ts +51 -0
- package/compiled/autoprefixer/postcss/lib/node.d.ts +444 -0
- package/compiled/autoprefixer/postcss/lib/postcss.d.ts +472 -0
- package/compiled/autoprefixer/postcss/lib/previous-map.d.ts +72 -0
- package/compiled/autoprefixer/postcss/lib/processor.d.ts +101 -0
- package/compiled/autoprefixer/postcss/lib/result.d.ts +195 -0
- package/compiled/autoprefixer/postcss/lib/root.d.ts +73 -0
- package/compiled/autoprefixer/postcss/lib/rule.d.ts +104 -0
- package/compiled/autoprefixer/postcss/lib/warning.d.ts +104 -0
- package/compiled/autoprefixer/source-map-js/source-map.d.ts +98 -0
- package/compiled/babel-loader/LICENSE +22 -0
- package/compiled/babel-loader/index.js +3 -0
- package/compiled/babel-loader/package.json +1 -0
- package/compiled/compression/LICENSE +23 -0
- package/compiled/compression/index.js +57 -0
- package/compiled/compression/package.json +1 -0
- package/compiled/connect-history-api-fallback/LICENSE +21 -0
- package/compiled/connect-history-api-fallback/index.js +1 -0
- package/compiled/connect-history-api-fallback/package.json +1 -0
- package/{lib/webpack/plugins/mini-css-extract-plugin → compiled/copy-webpack-plugin}/LICENSE +0 -0
- package/compiled/copy-webpack-plugin/index.js +46 -0
- package/compiled/copy-webpack-plugin/package.json +1 -0
- package/{lib/webpack/plugins/terser-webpack-plugin → compiled/css-loader}/LICENSE +0 -0
- package/compiled/css-loader/api.js +102 -0
- package/compiled/css-loader/getUrl.js +29 -0
- package/compiled/css-loader/index.js +2 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +22 -0
- package/compiled/css-minimizer-webpack-plugin/LICENSE +20 -0
- package/compiled/css-minimizer-webpack-plugin/index.js +3 -0
- package/compiled/css-minimizer-webpack-plugin/minify.js +72 -0
- package/compiled/css-minimizer-webpack-plugin/package.json +1 -0
- package/compiled/css-minimizer-webpack-plugin/utils.js +166 -0
- package/compiled/cssnano/index.js +192 -0
- package/compiled/cssnano/package.json +1 -0
- package/compiled/express/LICENSE +24 -0
- package/compiled/express/body-parser/index.d.ts +104 -0
- package/compiled/express/connect/index.d.ts +93 -0
- package/compiled/express/express-serve-static-core/index.d.ts +1252 -0
- package/compiled/express/index.d.ts +133 -0
- package/compiled/express/index.js +338 -0
- package/compiled/express/mime/index.d.ts +35 -0
- package/compiled/express/package.json +1 -0
- package/compiled/express/qs/index.d.ts +62 -0
- package/compiled/express/range-parser/index.d.ts +35 -0
- package/compiled/express/serve-static/index.d.ts +108 -0
- package/compiled/http-proxy-middleware/LICENSE +22 -0
- package/compiled/http-proxy-middleware/dist/index.d.ts +4 -0
- package/compiled/http-proxy-middleware/dist/types.d.ts +54 -0
- package/compiled/http-proxy-middleware/http-proxy/index.d.ts +226 -0
- package/compiled/http-proxy-middleware/index.js +66 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/less/index.js +31 -0
- package/compiled/less/package.json +1 -0
- package/compiled/less-loader/LICENSE +20 -0
- package/compiled/less-loader/index.js +1 -0
- package/compiled/less-loader/package.json +1 -0
- package/compiled/mini-css-extract-plugin/LICENSE +20 -0
- package/{lib/webpack/plugins/mini-css-extract-plugin/src → compiled/mini-css-extract-plugin}/hmr/hotModuleReplacement.js +50 -52
- package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +35 -0
- package/compiled/mini-css-extract-plugin/index.js +11606 -0
- package/compiled/mini-css-extract-plugin/loader-options.json +32 -0
- package/compiled/mini-css-extract-plugin/loader.js +315 -0
- package/compiled/mini-css-extract-plugin/package.json +1 -0
- package/compiled/mini-css-extract-plugin/utils.js +154 -0
- package/compiled/postcss-flexbugs-fixes/LICENSE +20 -0
- package/compiled/postcss-flexbugs-fixes/index.js +1 -0
- package/compiled/postcss-flexbugs-fixes/package.json +1 -0
- package/compiled/postcss-loader/LICENSE +20 -0
- package/compiled/postcss-loader/index.js +1 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/purgecss-webpack-plugin/LICENSE +21 -0
- package/compiled/purgecss-webpack-plugin/index.js +7781 -0
- package/compiled/purgecss-webpack-plugin/package.json +1 -0
- package/compiled/react-refresh/index.js +19 -0
- package/compiled/sass-loader/LICENSE +20 -0
- package/compiled/sass-loader/index.js +1 -0
- package/compiled/sass-loader/package.json +1 -0
- package/compiled/schema-utils/LICENSE +20 -0
- package/compiled/schema-utils/ajv/lib/ajv.d.ts +397 -0
- package/compiled/schema-utils/declarations/ValidationError.d.ts +74 -0
- package/compiled/schema-utils/declarations/index.d.ts +3 -0
- package/compiled/schema-utils/declarations/validate.d.ts +37 -0
- package/compiled/schema-utils/index.js +3 -0
- package/compiled/schema-utils/json-schema/index.d.ts +751 -0
- package/compiled/schema-utils/package.json +1 -0
- package/compiled/speed-measure-webpack-plugin/LICENSE +21 -0
- package/compiled/speed-measure-webpack-plugin/index.js +1 -0
- package/compiled/speed-measure-webpack-plugin/package.json +1 -0
- package/compiled/style-loader/LICENSE +20 -0
- package/compiled/style-loader/index.js +1 -0
- package/compiled/style-loader/package.json +1 -0
- package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
- package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +104 -0
- package/compiled/style-loader/runtime/insertBySelector.js +39 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +11 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +35 -0
- package/compiled/style-loader/runtime/isOldIE.js +19 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +16 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +10 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +12 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +93 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +70 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +16 -0
- package/compiled/svgo-loader/LICENSE +22 -0
- package/compiled/svgo-loader/index.js +4 -0
- package/compiled/svgo-loader/package.json +1 -0
- package/compiled/swc-loader/LICENSE +25 -0
- package/compiled/swc-loader/index.js +1 -0
- package/compiled/swc-loader/package.json +1 -0
- package/compiled/tapable/LICENSE +21 -0
- package/compiled/tapable/index.js +1 -0
- package/compiled/tapable/package.json +1 -0
- package/compiled/tapable/tapable.d.ts +116 -0
- package/compiled/terser/LICENSE +29 -0
- package/compiled/terser/index.js +1 -0
- package/compiled/terser/mappings.wasm +0 -0
- package/compiled/terser/package.json +1 -0
- package/compiled/terser/source-map/source-map.d.ts +369 -0
- package/compiled/terser/tools/terser.d.ts +207 -0
- package/compiled/terser-webpack-plugin/LICENSE +20 -0
- package/compiled/terser-webpack-plugin/ajv/lib/ajv.d.ts +397 -0
- package/compiled/terser-webpack-plugin/index.js +15142 -0
- package/compiled/terser-webpack-plugin/jest-worker/build/index.d.ts +49 -0
- package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +142 -0
- package/compiled/terser-webpack-plugin/json-schema/index.d.ts +751 -0
- package/compiled/terser-webpack-plugin/minify.js +43 -0
- package/compiled/terser-webpack-plugin/package.json +1 -0
- package/compiled/terser-webpack-plugin/schema-utils/declarations/ValidationError.d.ts +74 -0
- package/compiled/terser-webpack-plugin/schema-utils/declarations/index.d.ts +3 -0
- package/compiled/terser-webpack-plugin/schema-utils/declarations/validate.d.ts +37 -0
- package/compiled/terser-webpack-plugin/source-map/source-map.d.ts +98 -0
- package/compiled/terser-webpack-plugin/types/cjs.d.ts +3 -0
- package/compiled/terser-webpack-plugin/types/index.d.ts +295 -0
- package/compiled/terser-webpack-plugin/types/utils.d.ts +105 -0
- package/compiled/terser-webpack-plugin/utils.js +594 -0
- package/compiled/url-loader/LICENSE +20 -0
- package/compiled/url-loader/index.js +15 -0
- package/compiled/url-loader/package.json +1 -0
- package/compiled/webpack/Chunk.js +1 -0
- package/compiled/webpack/Compilation.js +1 -0
- package/compiled/webpack/HotModuleReplacement.runtime.js +394 -0
- package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +462 -0
- package/compiled/webpack/LICENSE +20 -0
- package/compiled/webpack/LibraryTemplatePlugin.js +1 -0
- package/compiled/webpack/LoaderTargetPlugin.js +1 -0
- package/compiled/webpack/ModuleFilenameHelpers.js +1 -0
- package/compiled/webpack/NormalModule.js +1 -0
- package/compiled/webpack/RuntimeGlobals.js +1 -0
- package/compiled/webpack/RuntimeModule.js +1 -0
- package/compiled/webpack/SingleEntryPlugin.js +1 -0
- package/compiled/webpack/Template.js +1 -0
- package/compiled/webpack/ajv/lib/ajv.d.ts +397 -0
- package/compiled/webpack/deepImports.json +12 -0
- package/compiled/webpack/index.js +162861 -0
- package/compiled/webpack/json-schema/index.d.ts +751 -0
- package/compiled/webpack/lazy-compilation-node.js +40 -0
- package/compiled/webpack/lazy-compilation-web.js +74 -0
- package/compiled/webpack/package.json +5 -0
- package/compiled/webpack/schema-utils/declarations/ValidationError.d.ts +74 -0
- package/compiled/webpack/schema-utils/declarations/index.d.ts +3 -0
- package/compiled/webpack/schema-utils/declarations/validate.d.ts +37 -0
- package/compiled/webpack/types.d.ts +12664 -0
- package/compiled/webpack-5-chain/LICENSE +373 -0
- package/compiled/webpack-5-chain/index.js +1 -0
- package/compiled/webpack-5-chain/package.json +1 -0
- package/compiled/webpack-5-chain/types/index.d.ts +543 -0
- package/compiled/webpack-bundle-analyzer/LICENSE +20 -0
- package/compiled/webpack-bundle-analyzer/index.js +30 -0
- package/compiled/webpack-bundle-analyzer/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -0
- package/compiled/webpack-dev-middleware/LICENSE +20 -0
- package/compiled/webpack-dev-middleware/index.js +21 -0
- package/compiled/webpack-dev-middleware/package.json +1 -0
- package/compiled/webpack-sources/LICENSE +21 -0
- package/compiled/webpack-sources/index.d.ts +20 -0
- package/compiled/webpack-sources/index.js +1 -0
- package/compiled/webpack-sources/lib/CachedSource.d.ts +18 -0
- package/compiled/webpack-sources/lib/CompatSource.d.ts +9 -0
- package/compiled/webpack-sources/lib/ConcatSource.d.ts +22 -0
- package/compiled/webpack-sources/lib/OriginalSource.d.ts +18 -0
- package/compiled/webpack-sources/lib/PrefixSource.d.ts +12 -0
- package/compiled/webpack-sources/lib/RawSource.d.ts +13 -0
- package/compiled/webpack-sources/lib/ReplaceSource.d.ts +35 -0
- package/compiled/webpack-sources/lib/SizeOnlySource.d.ts +7 -0
- package/compiled/webpack-sources/lib/Source.d.ts +45 -0
- package/compiled/webpack-sources/lib/SourceMapSource.d.ts +22 -0
- package/compiled/webpack-sources/lib/index.d.ts +60 -0
- package/compiled/webpack-sources/package.json +1 -0
- package/compiled/webpack-sources/source-list-map/index.d.ts +91 -0
- package/compiled/webpack-sources/source-map/source-map.d.ts +369 -0
- package/compiled/ws/LICENSE +19 -0
- package/compiled/ws/index.d.ts +359 -0
- package/compiled/ws/index.js +1 -0
- package/compiled/ws/package.json +1 -0
- package/dist/build.d.ts +16 -0
- package/dist/build.js +71 -0
- package/{lib → dist}/cli.d.ts +0 -0
- package/dist/cli.js +113 -0
- package/{lib/webpackHotDevClient/webpackHotDevClient.d.ts → dist/client/client.d.ts} +0 -0
- package/dist/client/client.js +239 -0
- package/dist/config/_sampleFeature.d.ts +10 -0
- package/dist/config/_sampleFeature.js +22 -0
- package/dist/config/assetRules.d.ts +11 -0
- package/dist/config/assetRules.js +57 -0
- package/dist/config/bundleAnalyzerPlugin.d.ts +10 -0
- package/dist/config/bundleAnalyzerPlugin.js +30 -0
- package/dist/config/compressPlugin.d.ts +10 -0
- package/dist/config/compressPlugin.js +77 -0
- package/dist/config/config.d.ts +19 -0
- package/dist/config/config.js +171 -0
- package/dist/config/copyPlugin.d.ts +10 -0
- package/dist/config/copyPlugin.js +49 -0
- package/dist/config/cssRules.d.ts +11 -0
- package/dist/config/cssRules.js +98 -0
- package/dist/config/definePlugin.d.ts +15 -0
- package/dist/config/definePlugin.js +45 -0
- package/dist/config/fastRefreshPlugin.d.ts +12 -0
- package/dist/config/fastRefreshPlugin.js +34 -0
- package/dist/config/ignorePlugin.d.ts +10 -0
- package/dist/config/ignorePlugin.js +27 -0
- package/dist/config/javaScriptRules.d.ts +14 -0
- package/dist/config/javaScriptRules.js +150 -0
- package/dist/config/miniCSSExtractPlugin.d.ts +10 -0
- package/dist/config/miniCSSExtractPlugin.js +34 -0
- package/dist/config/nodePolyfill.d.ts +10 -0
- package/dist/config/nodePolyfill.js +34 -0
- package/dist/config/progressPlugin.d.ts +11 -0
- package/dist/config/progressPlugin.js +27 -0
- package/dist/config/purgecssWebpackPlugin.d.ts +10 -0
- package/dist/config/purgecssWebpackPlugin.js +32 -0
- package/dist/config/speedMeasureWebpackPlugin.d.ts +6 -0
- package/dist/config/speedMeasureWebpackPlugin.js +34 -0
- package/dist/config/svgRules.d.ts +11 -0
- package/dist/config/svgRules.js +56 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.js +15 -0
- package/dist/dev.d.ts +18 -0
- package/dist/dev.js +80 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +16 -0
- package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +11 -0
- package/dist/plugins/ESBuildCSSMinifyPlugin.js +65 -0
- package/dist/plugins/ProgressPlugin.d.ts +15 -0
- package/dist/plugins/ProgressPlugin.js +44 -0
- package/dist/plugins/_SamplePlugin.d.ts +9 -0
- package/dist/plugins/_SamplePlugin.js +14 -0
- package/dist/requireHook.d.ts +1 -0
- package/dist/requireHook.js +31 -0
- package/dist/schema.d.ts +3 -0
- package/dist/schema.js +68 -0
- package/dist/server/server.d.ts +16 -0
- package/dist/server/server.js +157 -0
- package/dist/server/ws.d.ts +8 -0
- package/dist/server/ws.js +42 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.js +29 -0
- package/dist/utils/browsersList.d.ts +5 -0
- package/dist/utils/browsersList.js +10 -0
- package/dist/utils/depMatch.d.ts +6 -0
- package/dist/utils/depMatch.js +46 -0
- package/dist/utils/formatWebpackMessages.d.ts +12 -0
- package/dist/utils/formatWebpackMessages.js +100 -0
- package/package.json +163 -35
- package/bundled/css/hotModuleReplacement.js +0 -1203
- package/bundled/js/webpackHotDevClient.js +0 -13386
- package/lib/DevCompileDonePlugin.d.ts +0 -10
- package/lib/DevCompileDonePlugin.js +0 -53
- package/lib/cli.js +0 -184
- package/lib/getConfig/css.d.ts +0 -22
- package/lib/getConfig/css.js +0 -186
- package/lib/getConfig/getConfig.d.ts +0 -26
- package/lib/getConfig/getConfig.js +0 -578
- package/lib/getConfig/nodeModulesTransform.d.ts +0 -13
- package/lib/getConfig/nodeModulesTransform.js +0 -141
- package/lib/getConfig/pkgMatch.d.ts +0 -2
- package/lib/getConfig/pkgMatch.js +0 -58
- package/lib/getConfig/resolveDefine.d.ts +0 -5
- package/lib/getConfig/resolveDefine.js +0 -53
- package/lib/getConfig/runtimePublicPathEntry.d.ts +0 -1
- package/lib/getConfig/runtimePublicPathEntry.js +0 -3
- package/lib/getConfig/terserOptions.d.ts +0 -41
- package/lib/getConfig/terserOptions.js +0 -64
- package/lib/index.d.ts +0 -34
- package/lib/index.js +0 -314
- package/lib/requireHook.d.ts +0 -3
- package/lib/requireHook.js +0 -51
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependency.js +0 -94
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependencyTemplate.js +0 -26
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssLoadingRuntimeModule.js +0 -93
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModule.js +0 -164
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModuleFactory.js +0 -32
- package/lib/webpack/plugins/mini-css-extract-plugin/src/cjs.js +0 -15
- package/lib/webpack/plugins/mini-css-extract-plugin/src/index.js +0 -542
- package/lib/webpack/plugins/mini-css-extract-plugin/src/loader.js +0 -319
- package/lib/webpack/plugins/mini-css-extract-plugin/src/utils.js +0 -97
- package/lib/webpack/plugins/mini-css-extract-plugin.d.ts +0 -1
- package/lib/webpack/plugins/mini-css-extract-plugin.js +0 -15
- package/lib/webpack/plugins/terser-webpack-plugin/package.json +0 -3
- package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack4Cache.js +0 -187
- package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack5Cache.js +0 -61
- package/lib/webpack/plugins/terser-webpack-plugin/src/index.js +0 -683
- package/lib/webpack/plugins/terser-webpack-plugin/src/minify.js +0 -197
- package/lib/webpack/plugins/terser-webpack-plugin.d.ts +0 -1
- package/lib/webpack/plugins/terser-webpack-plugin.js +0 -15
- package/lib/webpackHotDevClient/formatWebpackMessages.d.ts +0 -11
- package/lib/webpackHotDevClient/formatWebpackMessages.js +0 -127
- package/lib/webpackHotDevClient/webpackHotDevClient.js +0 -311
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Configuration,
|
|
3
|
+
Compiler,
|
|
4
|
+
WebpackPluginInstance,
|
|
5
|
+
RuleSetRule,
|
|
6
|
+
ResolveOptions,
|
|
7
|
+
} from '@umijs/bunder-webpack/compiled/webpack';
|
|
8
|
+
import * as https from 'https';
|
|
9
|
+
|
|
10
|
+
export = Config;
|
|
11
|
+
|
|
12
|
+
declare namespace __Config {
|
|
13
|
+
class Chained<Parent> {
|
|
14
|
+
batch(handler: (chained: this) => void): this;
|
|
15
|
+
end(): Parent;
|
|
16
|
+
}
|
|
17
|
+
class TypedChainedMap<Parent, OptionsType> extends Chained<Parent> {
|
|
18
|
+
clear(): this;
|
|
19
|
+
delete(key: string): this;
|
|
20
|
+
has(key: string): boolean;
|
|
21
|
+
get<T extends keyof OptionsType>(key: T): OptionsType[T];
|
|
22
|
+
getOrCompute<T extends keyof OptionsType>(
|
|
23
|
+
key: T,
|
|
24
|
+
compute: () => OptionsType[T],
|
|
25
|
+
): OptionsType[T];
|
|
26
|
+
set<T extends keyof OptionsType>(key: T, value: OptionsType[T]): this;
|
|
27
|
+
merge(obj: Partial<OptionsType>): this;
|
|
28
|
+
entries(): OptionsType;
|
|
29
|
+
values<T extends keyof OptionsType>(): [OptionsType[T]][];
|
|
30
|
+
when(
|
|
31
|
+
condition: boolean,
|
|
32
|
+
trueBrancher: (obj: this) => void,
|
|
33
|
+
falseBrancher?: (obj: this) => void,
|
|
34
|
+
): this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class ChainedMap<Parent> extends TypedChainedMap<Parent, any> {}
|
|
38
|
+
class TypedChainedSet<Parent, Value> extends Chained<Parent> {
|
|
39
|
+
add(value: Value): this;
|
|
40
|
+
prepend(value: Value): this;
|
|
41
|
+
clear(): this;
|
|
42
|
+
delete(key: string): this;
|
|
43
|
+
has(key: string): boolean;
|
|
44
|
+
merge(arr: Value[]): this;
|
|
45
|
+
values(): Value[];
|
|
46
|
+
when(
|
|
47
|
+
condition: boolean,
|
|
48
|
+
trueBrancher: (obj: this) => void,
|
|
49
|
+
falseBrancher?: (obj: this) => void,
|
|
50
|
+
): this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
class ChainedSet<Parent> extends TypedChainedSet<Parent, any> {}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type WebpackConfig = Required<Configuration>;
|
|
57
|
+
declare class Config extends __Config.ChainedMap<void> {
|
|
58
|
+
entryPoints: Config.TypedChainedMap<
|
|
59
|
+
Config,
|
|
60
|
+
{ [key: string]: Config.EntryPoint }
|
|
61
|
+
>;
|
|
62
|
+
output: Config.Output;
|
|
63
|
+
module: Config.Module;
|
|
64
|
+
node: Config.ChainedMap<this> & ((value: boolean) => this);
|
|
65
|
+
optimization: Config.Optimization;
|
|
66
|
+
performance: Config.Performance & ((value: boolean) => this);
|
|
67
|
+
plugins: Config.Plugins<this, WebpackPluginInstance>;
|
|
68
|
+
resolve: Config.Resolve;
|
|
69
|
+
resolveLoader: Config.ResolveLoader;
|
|
70
|
+
devServer: Config.DevServer;
|
|
71
|
+
|
|
72
|
+
context(value: WebpackConfig['context']): this;
|
|
73
|
+
mode(value: WebpackConfig['mode']): this;
|
|
74
|
+
devtool(value: Config.DevTool): this;
|
|
75
|
+
target(value: WebpackConfig['target']): this;
|
|
76
|
+
watch(value: WebpackConfig['watch']): this;
|
|
77
|
+
watchOptions(value: WebpackConfig['watchOptions']): this;
|
|
78
|
+
externals(value: WebpackConfig['externals']): this;
|
|
79
|
+
externalsType(value: WebpackConfig['externalsType']): this;
|
|
80
|
+
externalsPresets(value: WebpackConfig['externalsPresets']): this;
|
|
81
|
+
stats(value: WebpackConfig['stats']): this;
|
|
82
|
+
experiments(value: WebpackConfig['experiments']): this;
|
|
83
|
+
amd(value: WebpackConfig['amd']): this;
|
|
84
|
+
bail(value: WebpackConfig['bail']): this;
|
|
85
|
+
cache(value: WebpackConfig['cache']): this;
|
|
86
|
+
dependencies(value: WebpackConfig['dependencies']): this;
|
|
87
|
+
ignoreWarnings(value: WebpackConfig['ignoreWarnings']): this;
|
|
88
|
+
loader(value: WebpackConfig['loader']): this;
|
|
89
|
+
parallelism(value: WebpackConfig['parallelism']): this;
|
|
90
|
+
profile(value: WebpackConfig['profile']): this;
|
|
91
|
+
recordsPath(value: WebpackConfig['recordsPath']): this;
|
|
92
|
+
recordsInputPath(value: WebpackConfig['recordsInputPath']): this;
|
|
93
|
+
recordsOutputPath(value: WebpackConfig['recordsOutputPath']): this;
|
|
94
|
+
name(value: WebpackConfig['name']): this;
|
|
95
|
+
infrastructureLogging(value: WebpackConfig['infrastructureLogging']): this;
|
|
96
|
+
snapshot(value: WebpackConfig['snapshot']): this;
|
|
97
|
+
|
|
98
|
+
entry(name: string): Config.EntryPoint;
|
|
99
|
+
plugin(name: string): Config.Plugin<this, WebpackPluginInstance>;
|
|
100
|
+
|
|
101
|
+
toConfig(): Configuration;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare namespace Config {
|
|
105
|
+
class Chained<Parent> extends __Config.Chained<Parent> {}
|
|
106
|
+
class TypedChainedMap<Parent, OptionsType> extends __Config.TypedChainedMap<
|
|
107
|
+
Parent,
|
|
108
|
+
OptionsType
|
|
109
|
+
> {}
|
|
110
|
+
class ChainedMap<Parent> extends __Config.TypedChainedMap<Parent, any> {}
|
|
111
|
+
class TypedChainedSet<Parent, Value> extends __Config.TypedChainedSet<
|
|
112
|
+
Parent,
|
|
113
|
+
Value
|
|
114
|
+
> {}
|
|
115
|
+
class ChainedSet<Parent> extends __Config.TypedChainedSet<Parent, any> {}
|
|
116
|
+
|
|
117
|
+
class Plugins<
|
|
118
|
+
Parent,
|
|
119
|
+
PluginType extends WebpackPluginInstance,
|
|
120
|
+
> extends TypedChainedMap<
|
|
121
|
+
Parent,
|
|
122
|
+
{ [key: string]: Plugin<Parent, PluginType> }
|
|
123
|
+
> {}
|
|
124
|
+
|
|
125
|
+
class Plugin<Parent, PluginType extends WebpackPluginInstance | ResolvePlugin>
|
|
126
|
+
extends ChainedMap<Parent>
|
|
127
|
+
implements Orderable
|
|
128
|
+
{
|
|
129
|
+
init<P extends PluginType | PluginClass<PluginType>>(
|
|
130
|
+
value: (
|
|
131
|
+
plugin: P,
|
|
132
|
+
args: P extends PluginClass<PluginType>
|
|
133
|
+
? ConstructorParameters<P>
|
|
134
|
+
: any[],
|
|
135
|
+
) => PluginType,
|
|
136
|
+
): this;
|
|
137
|
+
use<P extends string | PluginType | PluginClass<PluginType>>(
|
|
138
|
+
plugin: P,
|
|
139
|
+
args?: P extends PluginClass<PluginType>
|
|
140
|
+
? ConstructorParameters<P>
|
|
141
|
+
: any[],
|
|
142
|
+
): this;
|
|
143
|
+
tap<P extends PluginClass<PluginType>>(
|
|
144
|
+
f: (args: ConstructorParameters<P>) => ConstructorParameters<P>,
|
|
145
|
+
): this;
|
|
146
|
+
|
|
147
|
+
// Orderable
|
|
148
|
+
before(name: string): this;
|
|
149
|
+
after(name: string): this;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
type WebpackEntry = NonNullable<Configuration['entry']>;
|
|
153
|
+
|
|
154
|
+
type WepackEntryObject = Exclude<
|
|
155
|
+
WebpackEntry,
|
|
156
|
+
string | string[] | Function
|
|
157
|
+
>[string];
|
|
158
|
+
|
|
159
|
+
class EntryPoint extends TypedChainedSet<Config, WepackEntryObject> {}
|
|
160
|
+
|
|
161
|
+
type WebpackModule = Required<NonNullable<Configuration['module']>>;
|
|
162
|
+
|
|
163
|
+
class Module extends ChainedMap<Config> {
|
|
164
|
+
rules: TypedChainedMap<this, { [key: string]: Rule }>;
|
|
165
|
+
generator: ChainedMap<this>;
|
|
166
|
+
parser: ChainedMap<this>;
|
|
167
|
+
rule(name: string): Rule;
|
|
168
|
+
noParse(value: WebpackModule['noParse']): this;
|
|
169
|
+
unsafeCache(value: WebpackModule['unsafeCache']): this;
|
|
170
|
+
wrappedContextCritical(
|
|
171
|
+
value: WebpackModule['wrappedContextCritical'],
|
|
172
|
+
): this;
|
|
173
|
+
exprContextRegExp(value: WebpackModule['exprContextRegExp']): this;
|
|
174
|
+
wrappedContextRecursive(
|
|
175
|
+
value: WebpackModule['wrappedContextRecursive'],
|
|
176
|
+
): this;
|
|
177
|
+
strictExportPresence(value: WebpackModule['strictExportPresence']): this;
|
|
178
|
+
wrappedContextRegExp(value: WebpackModule['wrappedContextRegExp']): this;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
type WebpackOutput = Required<NonNullable<Configuration['output']>>;
|
|
182
|
+
|
|
183
|
+
class Output extends ChainedMap<Config> {
|
|
184
|
+
auxiliaryComment(value: WebpackOutput['auxiliaryComment']): this;
|
|
185
|
+
charset(value: WebpackOutput['charset']): this;
|
|
186
|
+
chunkFilename(value: WebpackOutput['chunkFilename']): this;
|
|
187
|
+
chunkLoadTimeout(value: WebpackOutput['chunkLoadTimeout']): this;
|
|
188
|
+
chunkLoadingGlobal(value: WebpackOutput['chunkLoadingGlobal']): this;
|
|
189
|
+
chunkLoading(value: WebpackOutput['chunkLoading']): this;
|
|
190
|
+
chunkFormat(value: WebpackOutput['chunkFormat']): this;
|
|
191
|
+
enabledChunkLoadingTypes(
|
|
192
|
+
value: WebpackOutput['enabledChunkLoadingTypes'],
|
|
193
|
+
): this;
|
|
194
|
+
crossOriginLoading(value: WebpackOutput['crossOriginLoading']): this;
|
|
195
|
+
devtoolFallbackModuleFilenameTemplate(
|
|
196
|
+
value: WebpackOutput['devtoolFallbackModuleFilenameTemplate'],
|
|
197
|
+
): this;
|
|
198
|
+
devtoolModuleFilenameTemplate(
|
|
199
|
+
value: WebpackOutput['devtoolModuleFilenameTemplate'],
|
|
200
|
+
): this;
|
|
201
|
+
devtoolNamespace(value: WebpackOutput['devtoolNamespace']): this;
|
|
202
|
+
filename(value: WebpackOutput['filename']): this;
|
|
203
|
+
assetModuleFilenamet(value: WebpackOutput['assetModuleFilename']): this;
|
|
204
|
+
globalObject(value: WebpackOutput['globalObject']): this;
|
|
205
|
+
uniqueName(value: WebpackOutput['uniqueName']): this;
|
|
206
|
+
hashDigest(value: WebpackOutput['hashDigest']): this;
|
|
207
|
+
hashDigestLength(value: WebpackOutput['hashDigestLength']): this;
|
|
208
|
+
hashFunction(value: WebpackOutput['hashFunction']): this;
|
|
209
|
+
hashSalt(value: WebpackOutput['hashSalt']): this;
|
|
210
|
+
hotUpdateChunkFilename(
|
|
211
|
+
value: WebpackOutput['hotUpdateChunkFilename'],
|
|
212
|
+
): this;
|
|
213
|
+
hotUpdateGlobal(value: WebpackOutput['hotUpdateGlobal']): this;
|
|
214
|
+
hotUpdateMainFilename(value: WebpackOutput['hotUpdateMainFilename']): this;
|
|
215
|
+
library(value: WebpackOutput['library']): this;
|
|
216
|
+
libraryExport(value: WebpackOutput['libraryExport']): this;
|
|
217
|
+
libraryTarget(value: WebpackOutput['libraryTarget']): this;
|
|
218
|
+
importFunctionName(value: WebpackOutput['importFunctionName']): this;
|
|
219
|
+
path(value: WebpackOutput['path']): this;
|
|
220
|
+
pathinfo(value: WebpackOutput['pathinfo']): this;
|
|
221
|
+
publicPath(value: WebpackOutput['publicPath']): this;
|
|
222
|
+
scriptType(value: WebpackOutput['scriptType']): this;
|
|
223
|
+
sourceMapFilename(value: WebpackOutput['sourceMapFilename']): this;
|
|
224
|
+
sourcePrefix(value: WebpackOutput['sourcePrefix']): this;
|
|
225
|
+
strictModuleErrorHandling(
|
|
226
|
+
value: WebpackOutput['strictModuleErrorHandling'],
|
|
227
|
+
): this;
|
|
228
|
+
strictModuleExceptionHandling(
|
|
229
|
+
value: WebpackOutput['strictModuleExceptionHandling'],
|
|
230
|
+
): this;
|
|
231
|
+
umdNamedDefine(value: WebpackOutput['umdNamedDefine']): this;
|
|
232
|
+
workerChunkLoading(value: WebpackOutput['workerChunkLoading']): this;
|
|
233
|
+
enabledLibraryTypes(value: WebpackOutput['enabledLibraryTypes']): this;
|
|
234
|
+
environment(value: WebpackOutput['environment']): this;
|
|
235
|
+
compareBeforeEmit(value: WebpackOutput['compareBeforeEmit']): this;
|
|
236
|
+
wasmLoading(value: WebpackOutput['wasmLoading']): this;
|
|
237
|
+
enabledWasmLoadingTypes(
|
|
238
|
+
value: WebpackOutput['enabledWasmLoadingTypes'],
|
|
239
|
+
): this;
|
|
240
|
+
iife(value: WebpackOutput['iife']): this;
|
|
241
|
+
module(value: WebpackOutput['module']): this;
|
|
242
|
+
clean(value: WebpackOutput['clean']): this;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// await for @types/webpack-dev-server update do v4 to remove all any
|
|
246
|
+
class DevServer extends ChainedMap<Config> {
|
|
247
|
+
allowedHosts: TypedChainedSet<this, string>;
|
|
248
|
+
after(value: (app: any, server: any, compiler: Compiler) => void): this;
|
|
249
|
+
before(value: (app: any, server: any, compiler: Compiler) => void): this;
|
|
250
|
+
bonjour(value: boolean): this;
|
|
251
|
+
clientLogLevel(
|
|
252
|
+
value:
|
|
253
|
+
| 'silent'
|
|
254
|
+
| 'trace'
|
|
255
|
+
| 'debug'
|
|
256
|
+
| 'info'
|
|
257
|
+
| 'warn'
|
|
258
|
+
| 'error'
|
|
259
|
+
| 'none'
|
|
260
|
+
| 'warning',
|
|
261
|
+
): this;
|
|
262
|
+
compress(value: boolean): this;
|
|
263
|
+
contentBase(value: boolean | string | string[]): this;
|
|
264
|
+
contentBasePublicPath(value: string): this;
|
|
265
|
+
disableHostCheck(value: boolean): this;
|
|
266
|
+
filename(value: string): this;
|
|
267
|
+
headers(value: { [header: string]: string }): this;
|
|
268
|
+
historyApiFallback(value: boolean | any): this;
|
|
269
|
+
host(value: string): this;
|
|
270
|
+
hot(value: boolean): this;
|
|
271
|
+
hotOnly(value: boolean): this;
|
|
272
|
+
http2(value: boolean): this;
|
|
273
|
+
https(value: boolean | https.ServerOptions): this;
|
|
274
|
+
index(value: string): this;
|
|
275
|
+
injectClient(value: boolean | ((compiler: Compiler) => boolean)): this;
|
|
276
|
+
injectHot(value: boolean | ((compiler: Compiler) => boolean)): this;
|
|
277
|
+
inline(value: boolean): this;
|
|
278
|
+
lazy(value: boolean): this;
|
|
279
|
+
liveReload(value: boolean): this;
|
|
280
|
+
mimeTypes(value: Object): this;
|
|
281
|
+
noInfo(value: boolean): this;
|
|
282
|
+
onListening(value: (server: any) => void): this;
|
|
283
|
+
open(value: boolean): this;
|
|
284
|
+
openPage(value: string | string[]): this;
|
|
285
|
+
overlay(value: boolean | { warnings?: boolean; errors?: boolean }): this;
|
|
286
|
+
pfx(value: string): this;
|
|
287
|
+
pfxPassphrase(value: string): this;
|
|
288
|
+
port(value: number): this;
|
|
289
|
+
progress(value: boolean): this;
|
|
290
|
+
proxy(value: any): this;
|
|
291
|
+
public(value: string): this;
|
|
292
|
+
publicPath(publicPath: string): this;
|
|
293
|
+
quiet(value: boolean): this;
|
|
294
|
+
serveIndex(value: boolean): this;
|
|
295
|
+
setup(value: (expressApp: any) => void): this;
|
|
296
|
+
socket(value: string): this;
|
|
297
|
+
sockHost(value: string): this;
|
|
298
|
+
sockPath(value: string): this;
|
|
299
|
+
sockPort(value: number): this;
|
|
300
|
+
staticOptions(value: any): this;
|
|
301
|
+
stats(value: Configuration['stats']): this;
|
|
302
|
+
stdin(value: boolean): this;
|
|
303
|
+
transportMode(
|
|
304
|
+
value:
|
|
305
|
+
| 'sockjs'
|
|
306
|
+
| 'ws'
|
|
307
|
+
| {
|
|
308
|
+
server: 'ws';
|
|
309
|
+
client: object;
|
|
310
|
+
}
|
|
311
|
+
| {
|
|
312
|
+
client: 'sockjs';
|
|
313
|
+
server: object;
|
|
314
|
+
}
|
|
315
|
+
| {
|
|
316
|
+
client: object;
|
|
317
|
+
server: object;
|
|
318
|
+
},
|
|
319
|
+
): this;
|
|
320
|
+
useLocalIp(value: boolean): this;
|
|
321
|
+
watchContentBase(value: boolean): this;
|
|
322
|
+
watchOptions(value: Configuration['watchOptions']): this;
|
|
323
|
+
writeToDisk(value: boolean): this;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
type WebpackPerformance = Exclude<
|
|
327
|
+
Required<NonNullable<Configuration['performance']>>,
|
|
328
|
+
false
|
|
329
|
+
>;
|
|
330
|
+
class Performance extends ChainedMap<Config> {
|
|
331
|
+
hints(value: WebpackPerformance['hints']): this;
|
|
332
|
+
maxEntrypointSize(value: WebpackPerformance['maxEntrypointSize']): this;
|
|
333
|
+
maxAssetSize(value: WebpackPerformance['maxAssetSize']): this;
|
|
334
|
+
assetFilter(value: WebpackPerformance['assetFilter']): this;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
type WebpackResolve = Required<NonNullable<Configuration['resolve']>>;
|
|
338
|
+
type ResolvePlugin = Exclude<
|
|
339
|
+
NonNullable<ResolveOptions['plugins']>[number],
|
|
340
|
+
'...'
|
|
341
|
+
>;
|
|
342
|
+
|
|
343
|
+
class Resolve<T = Config> extends ChainedMap<T> {
|
|
344
|
+
alias: TypedChainedMap<this, { [key: string]: string | false | string[] }>;
|
|
345
|
+
aliasFields: TypedChainedSet<this, WebpackResolve['aliasFields'][number]>;
|
|
346
|
+
descriptionFiles: TypedChainedSet<
|
|
347
|
+
this,
|
|
348
|
+
WebpackResolve['descriptionFiles'][number]
|
|
349
|
+
>;
|
|
350
|
+
extensions: TypedChainedSet<this, WebpackResolve['extensions'][number]>;
|
|
351
|
+
mainFields: TypedChainedSet<this, WebpackResolve['mainFields'][number]>;
|
|
352
|
+
mainFiles: TypedChainedSet<this, WebpackResolve['mainFiles'][number]>;
|
|
353
|
+
exportsFields: TypedChainedSet<
|
|
354
|
+
this,
|
|
355
|
+
WebpackResolve['exportsFields'][number]
|
|
356
|
+
>;
|
|
357
|
+
importsFields: TypedChainedSet<
|
|
358
|
+
this,
|
|
359
|
+
WebpackResolve['importsFields'][number]
|
|
360
|
+
>;
|
|
361
|
+
restrictions: TypedChainedSet<this, WebpackResolve['restrictions'][number]>;
|
|
362
|
+
roots: TypedChainedSet<this, WebpackResolve['roots'][number]>;
|
|
363
|
+
modules: TypedChainedSet<this, WebpackResolve['modules'][number]>;
|
|
364
|
+
plugins: TypedChainedMap<
|
|
365
|
+
this,
|
|
366
|
+
{ [key: string]: Plugin<Resolve, ResolvePlugin> }
|
|
367
|
+
>;
|
|
368
|
+
fallback: TypedChainedMap<
|
|
369
|
+
this,
|
|
370
|
+
{ [key: string]: string | false | string[] }
|
|
371
|
+
>;
|
|
372
|
+
byDependency: TypedChainedMap<this, WebpackResolve['byDependency']>;
|
|
373
|
+
|
|
374
|
+
cachePredicate(value: WebpackResolve['cachePredicate']): this;
|
|
375
|
+
cacheWithContext(value: WebpackResolve['cacheWithContext']): this;
|
|
376
|
+
enforceExtension(value: WebpackResolve['enforceExtension']): this;
|
|
377
|
+
symlinks(value: WebpackResolve['symlinks']): this;
|
|
378
|
+
unsafeCache(value: WebpackResolve['unsafeCache']): this;
|
|
379
|
+
preferRelative(value: WebpackResolve['preferRelative']): this;
|
|
380
|
+
preferAbsolute(value: WebpackResolve['preferAbsolute']): this;
|
|
381
|
+
|
|
382
|
+
plugin(name: string): Plugin<this, ResolvePlugin>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
class RuleResolve<T = Config> extends Resolve<T> {
|
|
386
|
+
fullySpecified(value: boolean): this;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
class ResolveLoader extends Resolve {
|
|
390
|
+
modules: ChainedSet<this>;
|
|
391
|
+
moduleExtensions: ChainedSet<this>;
|
|
392
|
+
packageMains: ChainedSet<this>;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
type WebpackRuleSet = Required<RuleSetRule>;
|
|
396
|
+
|
|
397
|
+
class Rule<T = Module> extends ChainedMap<T> implements Orderable {
|
|
398
|
+
uses: TypedChainedMap<this, { [key: string]: Use }>;
|
|
399
|
+
include: TypedChainedSet<this, WebpackRuleSet['include']>;
|
|
400
|
+
exclude: TypedChainedSet<this, WebpackRuleSet['exclude']>;
|
|
401
|
+
rules: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
|
|
402
|
+
oneOfs: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
|
|
403
|
+
resolve: RuleResolve<Rule<T>>;
|
|
404
|
+
|
|
405
|
+
enforce(value: WebpackRuleSet['enforce']): this;
|
|
406
|
+
issuer(value: WebpackRuleSet['issuer']): this;
|
|
407
|
+
issuerLayer(value: WebpackRuleSet['issuerLayer']): this;
|
|
408
|
+
layer(value: WebpackRuleSet['layer']): this;
|
|
409
|
+
mimetype(value: WebpackRuleSet['mimetype']): this;
|
|
410
|
+
parser(value: WebpackRuleSet['parser']): this;
|
|
411
|
+
generator(value: WebpackRuleSet['generator']): this;
|
|
412
|
+
resource(value: WebpackRuleSet['resource']): this;
|
|
413
|
+
resourceQuery(value: WebpackRuleSet['resourceQuery']): this;
|
|
414
|
+
sideEffects(value: WebpackRuleSet['sideEffects']): this;
|
|
415
|
+
test(value: WebpackRuleSet['test']): this;
|
|
416
|
+
type(value: WebpackRuleSet['type']): this;
|
|
417
|
+
|
|
418
|
+
use(name: string): Use<this>;
|
|
419
|
+
rule(name: string): Rule<Rule>;
|
|
420
|
+
oneOf(name: string): Rule<Rule>;
|
|
421
|
+
pre(): this;
|
|
422
|
+
post(): this;
|
|
423
|
+
before(name: string): this;
|
|
424
|
+
after(name: string): this;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
type WebpackOptimization = Required<
|
|
428
|
+
NonNullable<Configuration['optimization']>
|
|
429
|
+
>;
|
|
430
|
+
type SplitChunksObject = Exclude<WebpackOptimization['splitChunks'], false>;
|
|
431
|
+
class Optimization extends ChainedMap<Config> {
|
|
432
|
+
minimizer(name: string): Config.Plugin<this, WebpackPluginInstance>;
|
|
433
|
+
splitChunks: TypedChainedMap<this, SplitChunksObject> &
|
|
434
|
+
((value: SplitChunksObject | false) => this);
|
|
435
|
+
|
|
436
|
+
minimize(value: WebpackOptimization['minimize']): this;
|
|
437
|
+
runtimeChunk(value: WebpackOptimization['runtimeChunk']): this;
|
|
438
|
+
emitOnErrors(value: WebpackOptimization['emitOnErrors']): this;
|
|
439
|
+
moduleIds(value: WebpackOptimization['moduleIds']): this;
|
|
440
|
+
chunkIds(value: WebpackOptimization['chunkIds']): this;
|
|
441
|
+
nodeEnv(value: WebpackOptimization['nodeEnv']): this;
|
|
442
|
+
mangleWasmImports(value: WebpackOptimization['mangleWasmImports']): this;
|
|
443
|
+
removeAvailableModules(
|
|
444
|
+
value: WebpackOptimization['removeAvailableModules'],
|
|
445
|
+
): this;
|
|
446
|
+
removeEmptyChunks(value: WebpackOptimization['removeEmptyChunks']): this;
|
|
447
|
+
mergeDuplicateChunks(
|
|
448
|
+
value: WebpackOptimization['mergeDuplicateChunks'],
|
|
449
|
+
): this;
|
|
450
|
+
flagIncludedChunks(value: WebpackOptimization['flagIncludedChunks']): this;
|
|
451
|
+
providedExports(value: WebpackOptimization['providedExports']): this;
|
|
452
|
+
usedExports(value: WebpackOptimization['usedExports']): this;
|
|
453
|
+
concatenateModules(value: WebpackOptimization['concatenateModules']): this;
|
|
454
|
+
sideEffects(value: WebpackOptimization['sideEffects']): this;
|
|
455
|
+
portableRecords(value: WebpackOptimization['portableRecords']): this;
|
|
456
|
+
mangleExports(value: WebpackOptimization['mangleExports']): this;
|
|
457
|
+
innerGraph(value: WebpackOptimization['innerGraph']): this;
|
|
458
|
+
realContentHash(value: WebpackOptimization['realContentHash']): this;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
interface RuntimeChunk {
|
|
462
|
+
name: string | RuntimeChunkFunction;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
type RuntimeChunkFunction = (entryPoint: EntryPoint) => string;
|
|
466
|
+
|
|
467
|
+
interface SplitChunksOptions {
|
|
468
|
+
[name: string]: any;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
interface LoaderOptions {
|
|
472
|
+
[name: string]: any;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
class Use<Parent = Rule> extends ChainedMap<Parent> implements Orderable {
|
|
476
|
+
loader(value: string): this;
|
|
477
|
+
options(value: LoaderOptions): this;
|
|
478
|
+
|
|
479
|
+
tap(f: (options: LoaderOptions) => LoaderOptions): this;
|
|
480
|
+
|
|
481
|
+
// Orderable
|
|
482
|
+
before(name: string): this;
|
|
483
|
+
after(name: string): this;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
type DevTool =
|
|
487
|
+
| 'eval'
|
|
488
|
+
| 'inline-source-map'
|
|
489
|
+
| 'cheap-eval-source-map'
|
|
490
|
+
| 'cheap-source-map'
|
|
491
|
+
| 'cheap-module-eval-source-map'
|
|
492
|
+
| 'cheap-module-source-map'
|
|
493
|
+
| 'eval-source-map'
|
|
494
|
+
| 'source-map'
|
|
495
|
+
| 'nosources-source-map'
|
|
496
|
+
| 'hidden-source-map'
|
|
497
|
+
| 'nosources-source-map'
|
|
498
|
+
| '@eval'
|
|
499
|
+
| '@inline-source-map'
|
|
500
|
+
| '@cheap-eval-source-map'
|
|
501
|
+
| '@cheap-source-map'
|
|
502
|
+
| '@cheap-module-eval-source-map'
|
|
503
|
+
| '@cheap-module-source-map'
|
|
504
|
+
| '@eval-source-map'
|
|
505
|
+
| '@source-map'
|
|
506
|
+
| '@nosources-source-map'
|
|
507
|
+
| '@hidden-source-map'
|
|
508
|
+
| '@nosources-source-map'
|
|
509
|
+
| '#eval'
|
|
510
|
+
| '#inline-source-map'
|
|
511
|
+
| '#cheap-eval-source-map'
|
|
512
|
+
| '#cheap-source-map'
|
|
513
|
+
| '#cheap-module-eval-source-map'
|
|
514
|
+
| '#cheap-module-source-map'
|
|
515
|
+
| '#eval-source-map'
|
|
516
|
+
| '#source-map'
|
|
517
|
+
| '#nosources-source-map'
|
|
518
|
+
| '#hidden-source-map'
|
|
519
|
+
| '#nosources-source-map'
|
|
520
|
+
| '#@eval'
|
|
521
|
+
| '#@inline-source-map'
|
|
522
|
+
| '#@cheap-eval-source-map'
|
|
523
|
+
| '#@cheap-source-map'
|
|
524
|
+
| '#@cheap-module-eval-source-map'
|
|
525
|
+
| '#@cheap-module-source-map'
|
|
526
|
+
| '#@eval-source-map'
|
|
527
|
+
| '#@source-map'
|
|
528
|
+
| '#@nosources-source-map'
|
|
529
|
+
| '#@hidden-source-map'
|
|
530
|
+
| '#@nosources-source-map'
|
|
531
|
+
| boolean;
|
|
532
|
+
|
|
533
|
+
interface PluginClass<
|
|
534
|
+
PluginType extends WebpackPluginInstance | ResolvePlugin,
|
|
535
|
+
> {
|
|
536
|
+
new (...opts: any[]): PluginType;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
interface Orderable {
|
|
540
|
+
before(name: string): this;
|
|
541
|
+
after(name: string): this;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright JS Foundation and other contributors
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|