@ohos-ports/rsbuild-core 1.7.2-beta.1
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/LICENSE +21 -0
- package/README.md +27 -0
- package/bin/rsbuild.js +20 -0
- package/compiled/@jridgewell/remapping/index.d.ts +1 -0
- package/compiled/@jridgewell/remapping/index.js +1222 -0
- package/compiled/@jridgewell/remapping/license +19 -0
- package/compiled/@jridgewell/remapping/package.json +1 -0
- package/compiled/@jridgewell/trace-mapping/index.d.ts +194 -0
- package/compiled/@jridgewell/trace-mapping/index.js +1408 -0
- package/compiled/@jridgewell/trace-mapping/license +19 -0
- package/compiled/@jridgewell/trace-mapping/package.json +1 -0
- package/compiled/chokidar/index.d.ts +384 -0
- package/compiled/chokidar/index.js +1793 -0
- package/compiled/chokidar/license +21 -0
- package/compiled/chokidar/package.json +1 -0
- package/compiled/connect/index.d.ts +90 -0
- package/compiled/connect/index.js +1240 -0
- package/compiled/connect/license +25 -0
- package/compiled/connect/package.json +1 -0
- package/compiled/cors/index.d.ts +56 -0
- package/compiled/cors/index.js +371 -0
- package/compiled/cors/license +22 -0
- package/compiled/cors/package.json +1 -0
- package/compiled/css-loader/api.js +85 -0
- package/compiled/css-loader/getUrl.js +26 -0
- package/compiled/css-loader/index.d.ts +1 -0
- package/compiled/css-loader/index.js +2 -0
- package/compiled/css-loader/license +20 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +16 -0
- package/compiled/html-rspack-plugin/default_index.ejs +9 -0
- package/compiled/html-rspack-plugin/index.d.ts +290 -0
- package/compiled/html-rspack-plugin/index.js +1602 -0
- package/compiled/html-rspack-plugin/license +20 -0
- package/compiled/html-rspack-plugin/loader.js +166 -0
- package/compiled/html-rspack-plugin/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +319 -0
- package/compiled/http-proxy-middleware/index.js +5284 -0
- package/compiled/http-proxy-middleware/license +22 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/launch-editor-middleware/index.d.ts +1 -0
- package/compiled/launch-editor-middleware/index.js +719 -0
- package/compiled/launch-editor-middleware/license +21 -0
- package/compiled/launch-editor-middleware/package.json +1 -0
- package/compiled/memfs/index.d.ts +1462 -0
- package/compiled/memfs/index.js +1 -0
- package/compiled/memfs/license +201 -0
- package/compiled/memfs/package.json +1 -0
- package/compiled/mrmime/index.d.ts +4 -0
- package/compiled/mrmime/index.js +456 -0
- package/compiled/mrmime/package.json +1 -0
- package/compiled/picocolors/index.d.ts +55 -0
- package/compiled/picocolors/index.js +108 -0
- package/compiled/picocolors/license +15 -0
- package/compiled/picocolors/package.json +1 -0
- package/compiled/postcss/index.js +1 -0
- package/compiled/postcss/lib/at-rule.d.ts +140 -0
- package/compiled/postcss/lib/comment.d.ts +68 -0
- package/compiled/postcss/lib/container.d.ts +483 -0
- package/compiled/postcss/lib/css-syntax-error.d.ts +248 -0
- package/compiled/postcss/lib/declaration.d.ts +151 -0
- package/compiled/postcss/lib/document.d.ts +69 -0
- package/compiled/postcss/lib/fromJSON.d.ts +9 -0
- package/compiled/postcss/lib/input.d.ts +227 -0
- package/compiled/postcss/lib/lazy-result.d.ts +190 -0
- package/compiled/postcss/lib/list.d.ts +60 -0
- package/compiled/postcss/lib/no-work-result.d.ts +46 -0
- package/compiled/postcss/lib/node.d.ts +556 -0
- package/compiled/postcss/lib/parse.d.ts +9 -0
- package/compiled/postcss/lib/postcss.d.ts +458 -0
- package/compiled/postcss/lib/previous-map.d.ts +81 -0
- package/compiled/postcss/lib/processor.d.ts +115 -0
- package/compiled/postcss/lib/result.d.ts +205 -0
- package/compiled/postcss/lib/root.d.ts +87 -0
- package/compiled/postcss/lib/rule.d.ts +126 -0
- package/compiled/postcss/lib/source-map-js.d.ts +4 -0
- package/compiled/postcss/lib/stringifier.d.ts +46 -0
- package/compiled/postcss/lib/stringify.d.ts +9 -0
- package/compiled/postcss/lib/warning.d.ts +147 -0
- package/compiled/postcss/license +20 -0
- package/compiled/postcss/package.json +1 -0
- package/compiled/postcss-loader/index.d.ts +1 -0
- package/compiled/postcss-loader/index.js +720 -0
- package/compiled/postcss-loader/license +20 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/rslog/index.d.ts +67 -0
- package/compiled/rslog/license +21 -0
- package/compiled/rslog/package.json +1 -0
- package/compiled/rspack-chain/license +22 -0
- package/compiled/rspack-chain/package.json +1 -0
- package/compiled/rspack-chain/types/index.d.ts +545 -0
- package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
- package/compiled/rspack-manifest-plugin/index.js +409 -0
- package/compiled/rspack-manifest-plugin/license +21 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -0
- package/compiled/sirv/index.d.ts +1 -0
- package/compiled/sirv/index.js +274 -0
- package/compiled/sirv/package.json +1 -0
- package/compiled/style-loader/index.d.ts +1 -0
- package/compiled/style-loader/index.js +427 -0
- package/compiled/style-loader/license +20 -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 +84 -0
- package/compiled/style-loader/runtime/insertBySelector.js +34 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
- package/compiled/style-loader/runtime/isOldIE.js +17 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
- package/compiled/tinyglobby/index.d.ts +46 -0
- package/compiled/tinyglobby/index.js +2664 -0
- package/compiled/tinyglobby/license +21 -0
- package/compiled/tinyglobby/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
- package/compiled/webpack-bundle-analyzer/index.js +23 -0
- package/compiled/webpack-bundle-analyzer/license +20 -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-merge/index.d.ts +31 -0
- package/compiled/webpack-merge/index.js +1200 -0
- package/compiled/webpack-merge/license +20 -0
- package/compiled/webpack-merge/package.json +1 -0
- package/compiled/ws/index.d.ts +437 -0
- package/compiled/ws/index.js +3161 -0
- package/compiled/ws/license +20 -0
- package/compiled/ws/package.json +1 -0
- package/dist/0~open.js +427 -0
- package/dist/0~range-parser.js +49 -0
- package/dist/0~range-parser.js.LICENSE.txt +6 -0
- package/dist/131.js +9305 -0
- package/dist/131.js.LICENSE.txt +26 -0
- package/dist/136.mjs +42 -0
- package/dist/2~open.cjs +436 -0
- package/dist/2~range-parser.cjs +52 -0
- package/dist/2~range-parser.cjs.LICENSE.txt +6 -0
- package/dist/client/59.js +22 -0
- package/dist/client/hmr.js +206 -0
- package/dist/client/overlay.js +203 -0
- package/dist/ignoreCssLoader.mjs +3 -0
- package/dist/index.cjs +9456 -0
- package/dist/index.cjs.LICENSE.txt +26 -0
- package/dist/index.js +1 -0
- package/dist/rslib-runtime.js +44 -0
- package/dist/transformLoader.mjs +1 -0
- package/dist/transformRawLoader.mjs +4 -0
- package/dist-types/cli/commands.d.ts +28 -0
- package/dist-types/cli/index.d.ts +1 -0
- package/dist-types/cli/init.d.ts +7 -0
- package/dist-types/client/hmr.d.ts +3 -0
- package/dist-types/client/log.d.ts +13 -0
- package/dist-types/client/overlay.d.ts +1 -0
- package/dist-types/configChain.d.ts +154 -0
- package/dist-types/constants.d.ts +52 -0
- package/dist-types/createContext.d.ts +11 -0
- package/dist-types/createRsbuild.d.ts +5 -0
- package/dist-types/defaultConfig.d.ts +25 -0
- package/dist-types/helpers/compiler.d.ts +5 -0
- package/dist-types/helpers/exitHook.d.ts +3 -0
- package/dist-types/helpers/format.d.ts +2 -0
- package/dist-types/helpers/fs.d.ts +17 -0
- package/dist-types/helpers/index.d.ts +29 -0
- package/dist-types/helpers/path.d.ts +26 -0
- package/dist-types/helpers/stats.d.ts +18 -0
- package/dist-types/helpers/url.d.ts +11 -0
- package/dist-types/helpers/vendors.d.ts +29 -0
- package/dist-types/helpers/version.d.ts +7 -0
- package/dist-types/hooks.d.ts +44 -0
- package/dist-types/index.d.ts +22 -0
- package/dist-types/initPlugins.d.ts +6 -0
- package/dist-types/inspectConfig.d.ts +35 -0
- package/dist-types/loadConfig.d.ts +60 -0
- package/dist-types/loadEnv.d.ts +63 -0
- package/dist-types/loader/ignoreCssLoader.d.ts +3 -0
- package/dist-types/loader/transformLoader.d.ts +8 -0
- package/dist-types/loader/transformRawLoader.d.ts +3 -0
- package/dist-types/logger.d.ts +19 -0
- package/dist-types/mergeConfig.d.ts +2 -0
- package/dist-types/package.json +1 -0
- package/dist-types/pluginHelper.d.ts +12 -0
- package/dist-types/pluginManager.d.ts +21 -0
- package/dist-types/plugins/appIcon.d.ts +2 -0
- package/dist-types/plugins/asset.d.ts +3 -0
- package/dist-types/plugins/basic.d.ts +5 -0
- package/dist-types/plugins/bundleAnalyzer.d.ts +2 -0
- package/dist-types/plugins/cache.d.ts +2 -0
- package/dist-types/plugins/cleanOutput.d.ts +2 -0
- package/dist-types/plugins/css.d.ts +4 -0
- package/dist-types/plugins/define.d.ts +2 -0
- package/dist-types/plugins/entry.d.ts +2 -0
- package/dist-types/plugins/esm.d.ts +2 -0
- package/dist-types/plugins/externals.d.ts +2 -0
- package/dist-types/plugins/fileSize.d.ts +6 -0
- package/dist-types/plugins/html.d.ts +9 -0
- package/dist-types/plugins/inlineChunk.d.ts +6 -0
- package/dist-types/plugins/lazyCompilation.d.ts +2 -0
- package/dist-types/plugins/manifest.d.ts +2 -0
- package/dist-types/plugins/minimize.d.ts +10 -0
- package/dist-types/plugins/moduleFederation.d.ts +2 -0
- package/dist-types/plugins/moment.d.ts +2 -0
- package/dist-types/plugins/nodeAddons.d.ts +2 -0
- package/dist-types/plugins/nonce.d.ts +2 -0
- package/dist-types/plugins/output.d.ts +2 -0
- package/dist-types/plugins/performance.d.ts +5 -0
- package/dist-types/plugins/progress.d.ts +2 -0
- package/dist-types/plugins/resolve.d.ts +2 -0
- package/dist-types/plugins/resourceHints.d.ts +2 -0
- package/dist-types/plugins/rsdoctor.d.ts +2 -0
- package/dist-types/plugins/rspackProfile.d.ts +2 -0
- package/dist-types/plugins/server.d.ts +2 -0
- package/dist-types/plugins/sourceMap.d.ts +2 -0
- package/dist-types/plugins/splitChunks.d.ts +4 -0
- package/dist-types/plugins/sri.d.ts +2 -0
- package/dist-types/plugins/swc.d.ts +5 -0
- package/dist-types/plugins/target.d.ts +2 -0
- package/dist-types/plugins/wasm.d.ts +2 -0
- package/dist-types/provider/build.d.ts +4 -0
- package/dist-types/provider/createCompiler.d.ts +6 -0
- package/dist-types/provider/helpers.d.ts +12 -0
- package/dist-types/provider/initConfigs.d.ts +19 -0
- package/dist-types/provider/provider.d.ts +2 -0
- package/dist-types/provider/rspackConfig.d.ts +8 -0
- package/dist-types/restart.d.ts +18 -0
- package/dist-types/rspack-plugins/RsbuildHtmlPlugin.d.ts +38 -0
- package/dist-types/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +32 -0
- package/dist-types/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +28 -0
- package/dist-types/rspack-plugins/resource-hints/extractChunks.d.ts +23 -0
- package/dist-types/rspack-plugins/resource-hints/getResourceType.d.ts +22 -0
- package/dist-types/rspack.d.ts +2 -0
- package/dist-types/server/ansiHTML.d.ts +4 -0
- package/dist-types/server/assets-middleware/getFileFromUrl.d.ts +12 -0
- package/dist-types/server/assets-middleware/index.d.ts +37 -0
- package/dist-types/server/assets-middleware/middleware.d.ts +2 -0
- package/dist-types/server/assets-middleware/parseTokenList.d.ts +1 -0
- package/dist-types/server/assets-middleware/setupOutputFileSystem.d.ts +3 -0
- package/dist-types/server/assets-middleware/setupWriteToDisk.d.ts +15 -0
- package/dist-types/server/browserLogs.d.ts +9 -0
- package/dist-types/server/buildManager.d.ts +33 -0
- package/dist-types/server/cliShortcuts.d.ts +10 -0
- package/dist-types/server/devMiddlewares.d.ts +21 -0
- package/dist-types/server/devServer.d.ts +79 -0
- package/dist-types/server/environment.d.ts +8 -0
- package/dist-types/server/gracefulShutdown.d.ts +10 -0
- package/dist-types/server/gzipMiddleware.d.ts +2 -0
- package/dist-types/server/helper.d.ts +91 -0
- package/dist-types/server/historyApiFallback.d.ts +2 -0
- package/dist-types/server/hmrFallback.d.ts +1 -0
- package/dist-types/server/httpServer.d.ts +7 -0
- package/dist-types/server/middlewares.d.ts +33 -0
- package/dist-types/server/open.d.ts +10 -0
- package/dist-types/server/overlay.d.ts +3 -0
- package/dist-types/server/prodServer.d.ts +24 -0
- package/dist-types/server/proxy.d.ts +6 -0
- package/dist-types/server/runner/asModule.d.ts +2 -0
- package/dist-types/server/runner/basic.d.ts +29 -0
- package/dist-types/server/runner/cjs.d.ts +10 -0
- package/dist-types/server/runner/esm.d.ts +6 -0
- package/dist-types/server/runner/index.d.ts +4 -0
- package/dist-types/server/runner/type.d.ts +42 -0
- package/dist-types/server/socketServer.d.ts +81 -0
- package/dist-types/server/watchFiles.d.ts +14 -0
- package/dist-types/types/config.d.ts +1882 -0
- package/dist-types/types/context.d.ts +110 -0
- package/dist-types/types/hooks.d.ts +275 -0
- package/dist-types/types/index.d.ts +8 -0
- package/dist-types/types/plugin.d.ts +585 -0
- package/dist-types/types/rsbuild.d.ts +286 -0
- package/dist-types/types/rspack.d.ts +16 -0
- package/dist-types/types/thirdParty.d.ts +186 -0
- package/dist-types/types/utils.d.ts +19 -0
- package/package.json +114 -0
- package/static/openChrome.applescript +95 -0
- package/types.d.ts +349 -0
|
@@ -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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"postcss-loader","author":"Andrey Sitnik <andrey@sitnik.ru>","version":"8.2.0","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
type ColorFn = (input: string | number | null | undefined) => string;
|
|
2
|
+
|
|
3
|
+
declare let LOG_TYPES: {
|
|
4
|
+
error: {
|
|
5
|
+
label: string;
|
|
6
|
+
level: "error";
|
|
7
|
+
color: ColorFn;
|
|
8
|
+
};
|
|
9
|
+
warn: {
|
|
10
|
+
label: string;
|
|
11
|
+
level: "warn";
|
|
12
|
+
color: ColorFn;
|
|
13
|
+
};
|
|
14
|
+
info: {
|
|
15
|
+
label: string;
|
|
16
|
+
level: "info";
|
|
17
|
+
color: ColorFn;
|
|
18
|
+
};
|
|
19
|
+
start: {
|
|
20
|
+
label: string;
|
|
21
|
+
level: "info";
|
|
22
|
+
color: ColorFn;
|
|
23
|
+
};
|
|
24
|
+
ready: {
|
|
25
|
+
label: string;
|
|
26
|
+
level: "info";
|
|
27
|
+
color: ColorFn;
|
|
28
|
+
};
|
|
29
|
+
success: {
|
|
30
|
+
label: string;
|
|
31
|
+
level: "info";
|
|
32
|
+
color: ColorFn;
|
|
33
|
+
};
|
|
34
|
+
log: {
|
|
35
|
+
level: "info";
|
|
36
|
+
};
|
|
37
|
+
debug: {
|
|
38
|
+
label: string;
|
|
39
|
+
level: "verbose";
|
|
40
|
+
color: ColorFn;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
|
|
45
|
+
type LogMessage = unknown;
|
|
46
|
+
interface LogType {
|
|
47
|
+
label?: string;
|
|
48
|
+
level: LogLevel;
|
|
49
|
+
color?: ColorFn;
|
|
50
|
+
}
|
|
51
|
+
type LogFunction = (message?: LogMessage, ...args: any[]) => void;
|
|
52
|
+
interface Options {
|
|
53
|
+
level?: LogLevel;
|
|
54
|
+
}
|
|
55
|
+
type LogMethods = keyof typeof LOG_TYPES;
|
|
56
|
+
type Logger = Record<LogMethods, LogFunction> & {
|
|
57
|
+
greet: (message: string) => void;
|
|
58
|
+
level: LogLevel;
|
|
59
|
+
override: (customLogger: Partial<Record<LogMethods, LogFunction>>) => void;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
declare let createLogger: (options?: Options) => Logger;
|
|
63
|
+
|
|
64
|
+
declare let logger: Logger;
|
|
65
|
+
|
|
66
|
+
export { createLogger, logger };
|
|
67
|
+
export type { LogFunction, LogLevel, LogMessage, LogType, Logger, Options };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-present Bytedance, Inc. and its affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"rslog","version":"1.3.2","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-present Rspack Contrib
|
|
4
|
+
Copyright (c) 2017-2024 webpack-chain contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"rspack-chain","author":"rspack-contrib","version":"1.4.3","license":"MIT","types":"types/index.d.ts","type":"module"}
|
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Configuration,
|
|
3
|
+
Compiler,
|
|
4
|
+
RuleSetRule,
|
|
5
|
+
ResolveOptions,
|
|
6
|
+
} from '@rspack/core';
|
|
7
|
+
import * as https from 'https';
|
|
8
|
+
|
|
9
|
+
export default Config;
|
|
10
|
+
|
|
11
|
+
// The compiler type of Rspack / webpack are mismatch,
|
|
12
|
+
// so we use a loose type here to allow using webpack plugins.
|
|
13
|
+
interface PluginInstance {
|
|
14
|
+
apply: (compiler: any) => void;
|
|
15
|
+
[index: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare namespace __Config {
|
|
19
|
+
class Chained<Parent> {
|
|
20
|
+
batch(handler: (chained: this) => void): this;
|
|
21
|
+
end(): Parent;
|
|
22
|
+
}
|
|
23
|
+
class TypedChainedMap<Parent, OptionsType> extends Chained<Parent> {
|
|
24
|
+
clear(): this;
|
|
25
|
+
delete(key: string): this;
|
|
26
|
+
has(key: string): boolean;
|
|
27
|
+
get<T extends keyof OptionsType>(key: T): OptionsType[T];
|
|
28
|
+
getOrCompute<T extends keyof OptionsType>(
|
|
29
|
+
key: T,
|
|
30
|
+
compute: () => OptionsType[T],
|
|
31
|
+
): OptionsType[T];
|
|
32
|
+
set<T extends keyof OptionsType>(key: T, value: OptionsType[T]): this;
|
|
33
|
+
merge(obj: Partial<OptionsType>): this;
|
|
34
|
+
entries(): OptionsType;
|
|
35
|
+
values<T extends keyof OptionsType>(): OptionsType[T][];
|
|
36
|
+
when(
|
|
37
|
+
condition: boolean,
|
|
38
|
+
trueBrancher: (obj: this) => void,
|
|
39
|
+
falseBrancher?: (obj: this) => void,
|
|
40
|
+
): this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class ChainedMap<Parent> extends TypedChainedMap<Parent, any> {}
|
|
44
|
+
class TypedChainedSet<Parent, Value> extends Chained<Parent> {
|
|
45
|
+
add(value: Value): this;
|
|
46
|
+
prepend(value: Value): this;
|
|
47
|
+
clear(): this;
|
|
48
|
+
delete(key: string): this;
|
|
49
|
+
has(key: string): boolean;
|
|
50
|
+
merge(arr: Value[]): this;
|
|
51
|
+
values(): Value[];
|
|
52
|
+
when(
|
|
53
|
+
condition: boolean,
|
|
54
|
+
trueBrancher: (obj: this) => void,
|
|
55
|
+
falseBrancher?: (obj: this) => void,
|
|
56
|
+
): this;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
class ChainedSet<Parent> extends TypedChainedSet<Parent, any> {}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type RspackConfig = Required<Configuration>;
|
|
63
|
+
declare class Config extends __Config.ChainedMap<void> {
|
|
64
|
+
entryPoints: Config.TypedChainedMap<
|
|
65
|
+
Config,
|
|
66
|
+
{ [key: string]: Config.EntryPoint }
|
|
67
|
+
>;
|
|
68
|
+
output: Config.Output;
|
|
69
|
+
module: Config.Module;
|
|
70
|
+
node: Config.ChainedMap<this> & ((value: boolean) => this);
|
|
71
|
+
optimization: Config.Optimization;
|
|
72
|
+
performance: Config.Performance & ((value: boolean) => this);
|
|
73
|
+
plugins: Config.Plugins<this, PluginInstance>;
|
|
74
|
+
resolve: Config.Resolve;
|
|
75
|
+
resolveLoader: Config.ResolveLoader;
|
|
76
|
+
devServer: Config.DevServer;
|
|
77
|
+
|
|
78
|
+
context(value: RspackConfig['context']): this;
|
|
79
|
+
mode(value: RspackConfig['mode']): this;
|
|
80
|
+
devtool(value: Config.DevTool): this;
|
|
81
|
+
target(value: RspackConfig['target']): this;
|
|
82
|
+
watch(value: RspackConfig['watch']): this;
|
|
83
|
+
watchOptions(value: RspackConfig['watchOptions']): this;
|
|
84
|
+
externals(value: RspackConfig['externals']): this;
|
|
85
|
+
externalsType(value: RspackConfig['externalsType']): this;
|
|
86
|
+
externalsPresets(value: RspackConfig['externalsPresets']): this;
|
|
87
|
+
stats(value: RspackConfig['stats']): this;
|
|
88
|
+
experiments(value: RspackConfig['experiments']): this;
|
|
89
|
+
amd(value: RspackConfig['amd']): this;
|
|
90
|
+
bail(value: RspackConfig['bail']): this;
|
|
91
|
+
// Rspack only supports boolean cache
|
|
92
|
+
cache(value: any): this;
|
|
93
|
+
dependencies(value: RspackConfig['dependencies']): this;
|
|
94
|
+
ignoreWarnings(value: RspackConfig['ignoreWarnings']): this;
|
|
95
|
+
loader(value: RspackConfig['loader']): this;
|
|
96
|
+
// @ts-expect-error not supported by Rspack
|
|
97
|
+
parallelism(value: RspackConfig['parallelism']): this;
|
|
98
|
+
profile(value: RspackConfig['profile']): this;
|
|
99
|
+
// @ts-expect-error not supported by Rspack
|
|
100
|
+
recordsPath(value: RspackConfig['recordsPath']): this;
|
|
101
|
+
// @ts-expect-error not supported by Rspack
|
|
102
|
+
recordsInputPath(value: RspackConfig['recordsInputPath']): this;
|
|
103
|
+
// @ts-expect-error not supported by Rspack
|
|
104
|
+
recordsOutputPath(value: RspackConfig['recordsOutputPath']): this;
|
|
105
|
+
name(value: RspackConfig['name']): this;
|
|
106
|
+
infrastructureLogging(value: RspackConfig['infrastructureLogging']): this;
|
|
107
|
+
snapshot(value: RspackConfig['snapshot']): this;
|
|
108
|
+
lazyCompilation(value: RspackConfig['lazyCompilation']): this;
|
|
109
|
+
|
|
110
|
+
entry(name: string): Config.EntryPoint;
|
|
111
|
+
plugin(name: string): Config.Plugin<this, PluginInstance>;
|
|
112
|
+
|
|
113
|
+
toConfig(): Configuration;
|
|
114
|
+
|
|
115
|
+
static toString(
|
|
116
|
+
config: any,
|
|
117
|
+
{
|
|
118
|
+
verbose,
|
|
119
|
+
configPrefix,
|
|
120
|
+
}?: {
|
|
121
|
+
verbose?: boolean | undefined;
|
|
122
|
+
configPrefix?: string | undefined;
|
|
123
|
+
},
|
|
124
|
+
): string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare namespace Config {
|
|
128
|
+
class Chained<Parent> extends __Config.Chained<Parent> {}
|
|
129
|
+
class TypedChainedMap<Parent, OptionsType> extends __Config.TypedChainedMap<
|
|
130
|
+
Parent,
|
|
131
|
+
OptionsType
|
|
132
|
+
> {}
|
|
133
|
+
class ChainedMap<Parent> extends __Config.TypedChainedMap<Parent, any> {}
|
|
134
|
+
class TypedChainedSet<Parent, Value> extends __Config.TypedChainedSet<
|
|
135
|
+
Parent,
|
|
136
|
+
Value
|
|
137
|
+
> {}
|
|
138
|
+
class ChainedSet<Parent> extends __Config.TypedChainedSet<Parent, any> {}
|
|
139
|
+
|
|
140
|
+
class Plugins<
|
|
141
|
+
Parent,
|
|
142
|
+
PluginType extends PluginInstance,
|
|
143
|
+
> extends TypedChainedMap<
|
|
144
|
+
Parent,
|
|
145
|
+
{ [key: string]: Plugin<Parent, PluginType> }
|
|
146
|
+
> {}
|
|
147
|
+
|
|
148
|
+
class Plugin<Parent, PluginType extends PluginInstance | ResolvePlugin>
|
|
149
|
+
extends ChainedMap<Parent>
|
|
150
|
+
implements Orderable
|
|
151
|
+
{
|
|
152
|
+
init<P extends PluginType | PluginClass<PluginType>>(
|
|
153
|
+
value: (
|
|
154
|
+
plugin: P,
|
|
155
|
+
args: P extends PluginClass<PluginType>
|
|
156
|
+
? ConstructorParameters<P>
|
|
157
|
+
: any[],
|
|
158
|
+
) => PluginType,
|
|
159
|
+
): this;
|
|
160
|
+
use<P extends string | PluginType | PluginClass<PluginType>>(
|
|
161
|
+
plugin: P,
|
|
162
|
+
args?: P extends PluginClass<PluginType>
|
|
163
|
+
? ConstructorParameters<P>
|
|
164
|
+
: any[],
|
|
165
|
+
): this;
|
|
166
|
+
tap<P extends PluginClass<PluginType>>(
|
|
167
|
+
f: (args: ConstructorParameters<P>) => ConstructorParameters<P>,
|
|
168
|
+
): this;
|
|
169
|
+
|
|
170
|
+
// Orderable
|
|
171
|
+
before(name: string): this;
|
|
172
|
+
after(name: string): this;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
type RspackEntry = NonNullable<Configuration['entry']>;
|
|
176
|
+
|
|
177
|
+
type RspackEntryObject = Exclude<
|
|
178
|
+
RspackEntry,
|
|
179
|
+
string | string[] | Function
|
|
180
|
+
>[string];
|
|
181
|
+
|
|
182
|
+
class EntryPoint extends TypedChainedSet<Config, RspackEntryObject> {}
|
|
183
|
+
|
|
184
|
+
type RspackModule = Required<NonNullable<Configuration['module']>>;
|
|
185
|
+
|
|
186
|
+
class Module extends ChainedMap<Config> {
|
|
187
|
+
rules: TypedChainedMap<this, { [key: string]: Rule }>;
|
|
188
|
+
generator: ChainedMap<this>;
|
|
189
|
+
parser: ChainedMap<this>;
|
|
190
|
+
rule(name: string): Rule;
|
|
191
|
+
noParse(value: RspackModule['noParse']): this;
|
|
192
|
+
unsafeCache(value: RspackModule['unsafeCache']): this;
|
|
193
|
+
// @ts-expect-error not supported by Rspack
|
|
194
|
+
wrappedContextCritical(value: RspackModule['wrappedContextCritical']): this;
|
|
195
|
+
// @ts-expect-error not supported by Rspack
|
|
196
|
+
exprContextRegExp(value: RspackModule['exprContextRegExp']): this;
|
|
197
|
+
wrappedContextRecursive(
|
|
198
|
+
// @ts-expect-error not supported by Rspack
|
|
199
|
+
value: RspackModule['wrappedContextRecursive'],
|
|
200
|
+
): this;
|
|
201
|
+
// @ts-expect-error not supported by Rspack
|
|
202
|
+
strictExportPresence(value: RspackModule['strictExportPresence']): this;
|
|
203
|
+
// @ts-expect-error not supported by Rspack
|
|
204
|
+
wrappedContextRegExp(value: RspackModule['wrappedContextRegExp']): this;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
type RspackOutput = Required<NonNullable<Configuration['output']>>;
|
|
208
|
+
|
|
209
|
+
class Output extends ChainedMap<Config> {
|
|
210
|
+
auxiliaryComment(value: RspackOutput['auxiliaryComment']): this;
|
|
211
|
+
charset(value: RspackOutput['charset']): this;
|
|
212
|
+
chunkFilename(value: RspackOutput['chunkFilename']): this;
|
|
213
|
+
chunkLoadTimeout(value: RspackOutput['chunkLoadTimeout']): this;
|
|
214
|
+
chunkLoadingGlobal(value: RspackOutput['chunkLoadingGlobal']): this;
|
|
215
|
+
chunkLoading(value: RspackOutput['chunkLoading']): this;
|
|
216
|
+
chunkFormat(value: RspackOutput['chunkFormat']): this;
|
|
217
|
+
enabledChunkLoadingTypes(
|
|
218
|
+
value: RspackOutput['enabledChunkLoadingTypes'],
|
|
219
|
+
): this;
|
|
220
|
+
crossOriginLoading(value: RspackOutput['crossOriginLoading']): this;
|
|
221
|
+
devtoolFallbackModuleFilenameTemplate(
|
|
222
|
+
value: RspackOutput['devtoolFallbackModuleFilenameTemplate'],
|
|
223
|
+
): this;
|
|
224
|
+
devtoolModuleFilenameTemplate(
|
|
225
|
+
value: RspackOutput['devtoolModuleFilenameTemplate'],
|
|
226
|
+
): this;
|
|
227
|
+
devtoolNamespace(value: RspackOutput['devtoolNamespace']): this;
|
|
228
|
+
filename(value: RspackOutput['filename']): this;
|
|
229
|
+
assetModuleFilename(value: RspackOutput['assetModuleFilename']): this;
|
|
230
|
+
globalObject(value: RspackOutput['globalObject']): this;
|
|
231
|
+
uniqueName(value: RspackOutput['uniqueName']): this;
|
|
232
|
+
hashDigest(value: RspackOutput['hashDigest']): this;
|
|
233
|
+
hashDigestLength(value: RspackOutput['hashDigestLength']): this;
|
|
234
|
+
hashFunction(value: RspackOutput['hashFunction']): this;
|
|
235
|
+
hashSalt(value: RspackOutput['hashSalt']): this;
|
|
236
|
+
hotUpdateChunkFilename(value: RspackOutput['hotUpdateChunkFilename']): this;
|
|
237
|
+
hotUpdateGlobal(value: RspackOutput['hotUpdateGlobal']): this;
|
|
238
|
+
hotUpdateMainFilename(value: RspackOutput['hotUpdateMainFilename']): this;
|
|
239
|
+
library(value: RspackOutput['library']): this;
|
|
240
|
+
libraryExport(value: RspackOutput['libraryExport']): this;
|
|
241
|
+
libraryTarget(value: RspackOutput['libraryTarget']): this;
|
|
242
|
+
importFunctionName(value: RspackOutput['importFunctionName']): this;
|
|
243
|
+
path(value: RspackOutput['path']): this;
|
|
244
|
+
pathinfo(value: RspackOutput['pathinfo']): this;
|
|
245
|
+
publicPath(value: RspackOutput['publicPath']): this;
|
|
246
|
+
scriptType(value: RspackOutput['scriptType']): this;
|
|
247
|
+
sourceMapFilename(value: RspackOutput['sourceMapFilename']): this;
|
|
248
|
+
// @ts-expect-error not supported by Rspack
|
|
249
|
+
sourcePrefix(value: RspackOutput['sourcePrefix']): this;
|
|
250
|
+
strictModuleErrorHandling(
|
|
251
|
+
value: RspackOutput['strictModuleErrorHandling'],
|
|
252
|
+
): this;
|
|
253
|
+
strictModuleExceptionHandling(
|
|
254
|
+
value: RspackOutput['strictModuleExceptionHandling'],
|
|
255
|
+
): this;
|
|
256
|
+
umdNamedDefine(value: RspackOutput['umdNamedDefine']): this;
|
|
257
|
+
workerChunkLoading(value: RspackOutput['workerChunkLoading']): this;
|
|
258
|
+
enabledLibraryTypes(value: RspackOutput['enabledLibraryTypes']): this;
|
|
259
|
+
environment(value: RspackOutput['environment']): this;
|
|
260
|
+
compareBeforeEmit(value: RspackOutput['compareBeforeEmit']): this;
|
|
261
|
+
wasmLoading(value: RspackOutput['wasmLoading']): this;
|
|
262
|
+
webassemblyModuleFilename(
|
|
263
|
+
value: RspackOutput['webassemblyModuleFilename'],
|
|
264
|
+
): this;
|
|
265
|
+
enabledWasmLoadingTypes(
|
|
266
|
+
value: RspackOutput['enabledWasmLoadingTypes'],
|
|
267
|
+
): this;
|
|
268
|
+
iife(value: RspackOutput['iife']): this;
|
|
269
|
+
module(value: RspackOutput['module']): this;
|
|
270
|
+
clean(value: RspackOutput['clean']): this;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// await for @types/webpack-dev-server update do v4 to remove all any
|
|
274
|
+
class DevServer extends ChainedMap<Config> {
|
|
275
|
+
allowedHosts: TypedChainedSet<this, string>;
|
|
276
|
+
after(value: (app: any, server: any, compiler: Compiler) => void): this;
|
|
277
|
+
before(value: (app: any, server: any, compiler: Compiler) => void): this;
|
|
278
|
+
bonjour(value: boolean): this;
|
|
279
|
+
clientLogLevel(
|
|
280
|
+
value:
|
|
281
|
+
| 'silent'
|
|
282
|
+
| 'trace'
|
|
283
|
+
| 'debug'
|
|
284
|
+
| 'info'
|
|
285
|
+
| 'warn'
|
|
286
|
+
| 'error'
|
|
287
|
+
| 'none'
|
|
288
|
+
| 'warning',
|
|
289
|
+
): this;
|
|
290
|
+
compress(value: boolean): this;
|
|
291
|
+
contentBase(value: boolean | string | string[]): this;
|
|
292
|
+
contentBasePublicPath(value: string): this;
|
|
293
|
+
disableHostCheck(value: boolean): this;
|
|
294
|
+
filename(value: string): this;
|
|
295
|
+
headers(value: { [header: string]: string }): this;
|
|
296
|
+
historyApiFallback(value: boolean | any): this;
|
|
297
|
+
host(value: string): this;
|
|
298
|
+
hot(value: boolean): this;
|
|
299
|
+
hotOnly(value: boolean): this;
|
|
300
|
+
http2(value: boolean): this;
|
|
301
|
+
https(value: boolean | https.ServerOptions): this;
|
|
302
|
+
index(value: string): this;
|
|
303
|
+
injectClient(value: boolean | ((compiler: Compiler) => boolean)): this;
|
|
304
|
+
injectHot(value: boolean | ((compiler: Compiler) => boolean)): this;
|
|
305
|
+
inline(value: boolean): this;
|
|
306
|
+
lazy(value: boolean): this;
|
|
307
|
+
liveReload(value: boolean): this;
|
|
308
|
+
mimeTypes(value: Object): this;
|
|
309
|
+
noInfo(value: boolean): this;
|
|
310
|
+
onListening(value: (server: any) => void): this;
|
|
311
|
+
open(value: boolean): this;
|
|
312
|
+
openPage(value: string | string[]): this;
|
|
313
|
+
overlay(value: boolean | { warnings?: boolean; errors?: boolean }): this;
|
|
314
|
+
pfx(value: string): this;
|
|
315
|
+
pfxPassphrase(value: string): this;
|
|
316
|
+
port(value: number): this;
|
|
317
|
+
progress(value: boolean): this;
|
|
318
|
+
proxy(value: any): this;
|
|
319
|
+
public(value: string): this;
|
|
320
|
+
publicPath(publicPath: string): this;
|
|
321
|
+
quiet(value: boolean): this;
|
|
322
|
+
serveIndex(value: boolean): this;
|
|
323
|
+
setup(value: (expressApp: any) => void): this;
|
|
324
|
+
socket(value: string): this;
|
|
325
|
+
sockHost(value: string): this;
|
|
326
|
+
sockPath(value: string): this;
|
|
327
|
+
sockPort(value: number): this;
|
|
328
|
+
staticOptions(value: any): this;
|
|
329
|
+
stats(value: Configuration['stats']): this;
|
|
330
|
+
stdin(value: boolean): this;
|
|
331
|
+
transportMode(
|
|
332
|
+
value:
|
|
333
|
+
| 'sockjs'
|
|
334
|
+
| 'ws'
|
|
335
|
+
| {
|
|
336
|
+
server: 'ws';
|
|
337
|
+
client: object;
|
|
338
|
+
}
|
|
339
|
+
| {
|
|
340
|
+
client: 'sockjs';
|
|
341
|
+
server: object;
|
|
342
|
+
}
|
|
343
|
+
| {
|
|
344
|
+
client: object;
|
|
345
|
+
server: object;
|
|
346
|
+
},
|
|
347
|
+
): this;
|
|
348
|
+
useLocalIp(value: boolean): this;
|
|
349
|
+
watchContentBase(value: boolean): this;
|
|
350
|
+
watchOptions(value: Configuration['watchOptions']): this;
|
|
351
|
+
writeToDisk(value: boolean): this;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
type RspackPerformance = Exclude<
|
|
355
|
+
Required<NonNullable<Configuration['performance']>>,
|
|
356
|
+
false
|
|
357
|
+
>;
|
|
358
|
+
class Performance extends ChainedMap<Config> {
|
|
359
|
+
hints(value: RspackPerformance['hints']): this;
|
|
360
|
+
maxEntrypointSize(value: RspackPerformance['maxEntrypointSize']): this;
|
|
361
|
+
maxAssetSize(value: RspackPerformance['maxAssetSize']): this;
|
|
362
|
+
assetFilter(value: RspackPerformance['assetFilter']): this;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
type RspackResolve = Required<NonNullable<Configuration['resolve']>>;
|
|
366
|
+
type ResolvePlugin = Exclude<
|
|
367
|
+
// @ts-expect-error Rspack does not supports resolve plugin
|
|
368
|
+
NonNullable<ResolveOptions['plugins']>[number],
|
|
369
|
+
'...'
|
|
370
|
+
>;
|
|
371
|
+
|
|
372
|
+
class Resolve<T = Config> extends ChainedMap<T> {
|
|
373
|
+
alias: TypedChainedMap<this, { [key: string]: string | false | string[] }>;
|
|
374
|
+
aliasFields: TypedChainedSet<this, RspackResolve['aliasFields'][number]>;
|
|
375
|
+
conditionNames: TypedChainedSet<
|
|
376
|
+
this,
|
|
377
|
+
RspackResolve['conditionNames'][number]
|
|
378
|
+
>;
|
|
379
|
+
descriptionFiles: TypedChainedSet<
|
|
380
|
+
this,
|
|
381
|
+
RspackResolve['descriptionFiles'][number]
|
|
382
|
+
>;
|
|
383
|
+
extensions: TypedChainedSet<this, RspackResolve['extensions'][number]>;
|
|
384
|
+
extensionAlias: TypedChainedMap<this, RspackResolve['extensionAlias']>;
|
|
385
|
+
mainFields: TypedChainedSet<this, RspackResolve['mainFields'][number]>;
|
|
386
|
+
mainFiles: TypedChainedSet<this, RspackResolve['mainFiles'][number]>;
|
|
387
|
+
exportsFields: TypedChainedSet<
|
|
388
|
+
this,
|
|
389
|
+
RspackResolve['exportsFields'][number]
|
|
390
|
+
>;
|
|
391
|
+
importsFields: TypedChainedSet<
|
|
392
|
+
this,
|
|
393
|
+
RspackResolve['importsFields'][number]
|
|
394
|
+
>;
|
|
395
|
+
restrictions: TypedChainedSet<this, RspackResolve['restrictions'][number]>;
|
|
396
|
+
roots: TypedChainedSet<this, RspackResolve['roots'][number]>;
|
|
397
|
+
modules: TypedChainedSet<this, RspackResolve['modules'][number]>;
|
|
398
|
+
plugins: TypedChainedMap<
|
|
399
|
+
this,
|
|
400
|
+
{ [key: string]: Plugin<Resolve, ResolvePlugin> }
|
|
401
|
+
>;
|
|
402
|
+
fallback: TypedChainedMap<
|
|
403
|
+
this,
|
|
404
|
+
{ [key: string]: string | false | string[] }
|
|
405
|
+
>;
|
|
406
|
+
byDependency: TypedChainedMap<this, RspackResolve['byDependency']>;
|
|
407
|
+
|
|
408
|
+
// @ts-expect-error not supported by Rspack
|
|
409
|
+
cachePredicate(value: RspackResolve['cachePredicate']): this;
|
|
410
|
+
// @ts-expect-error not supported by Rspack
|
|
411
|
+
cacheWithContext(value: RspackResolve['cacheWithContext']): this;
|
|
412
|
+
enforceExtension(value: RspackResolve['enforceExtension']): this;
|
|
413
|
+
symlinks(value: RspackResolve['symlinks']): this;
|
|
414
|
+
// @ts-expect-error not supported by Rspack
|
|
415
|
+
unsafeCache(value: RspackResolve['unsafeCache']): this;
|
|
416
|
+
preferRelative(value: RspackResolve['preferRelative']): this;
|
|
417
|
+
preferAbsolute(value: RspackResolve['preferAbsolute']): this;
|
|
418
|
+
|
|
419
|
+
plugin(name: string): Plugin<this, ResolvePlugin>;
|
|
420
|
+
tsConfig(value: RspackResolve['tsConfig']): this;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
class RuleResolve<T = Config> extends Resolve<T> {
|
|
424
|
+
fullySpecified(value: boolean): this;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
class ResolveLoader extends Resolve {
|
|
428
|
+
modules: ChainedSet<this>;
|
|
429
|
+
moduleExtensions: ChainedSet<this>;
|
|
430
|
+
packageMains: ChainedSet<this>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
type RspackRuleSet = Required<RuleSetRule>;
|
|
434
|
+
|
|
435
|
+
class Rule<T = Module> extends ChainedMap<T> implements Orderable {
|
|
436
|
+
uses: TypedChainedMap<this, { [key: string]: Use }>;
|
|
437
|
+
include: TypedChainedSet<this, RspackRuleSet['include']>;
|
|
438
|
+
exclude: TypedChainedSet<this, RspackRuleSet['exclude']>;
|
|
439
|
+
rules: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
|
|
440
|
+
oneOfs: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
|
|
441
|
+
resolve: RuleResolve<Rule<T>>;
|
|
442
|
+
|
|
443
|
+
dependency(value: RspackRuleSet['dependency']): this;
|
|
444
|
+
enforce(value: RspackRuleSet['enforce']): this;
|
|
445
|
+
issuer(value: RspackRuleSet['issuer']): this;
|
|
446
|
+
issuerLayer(value: RspackRuleSet['issuerLayer']): this;
|
|
447
|
+
layer(value: RspackRuleSet['layer']): this;
|
|
448
|
+
mimetype(value: RspackRuleSet['mimetype']): this;
|
|
449
|
+
parser(value: RspackRuleSet['parser']): this;
|
|
450
|
+
generator(value: RspackRuleSet['generator']): this;
|
|
451
|
+
resource(value: RspackRuleSet['resource']): this;
|
|
452
|
+
resourceFragment(value: RspackRuleSet['resourceFragment']): this;
|
|
453
|
+
resourceQuery(value: RspackRuleSet['resourceQuery']): this;
|
|
454
|
+
sideEffects(value: RspackRuleSet['sideEffects']): this;
|
|
455
|
+
with(value: RspackRuleSet['with']): this;
|
|
456
|
+
test(value: RspackRuleSet['test']): this;
|
|
457
|
+
type(value: RspackRuleSet['type']): this;
|
|
458
|
+
|
|
459
|
+
use(name: string): Use<this>;
|
|
460
|
+
rule(name: string): Rule<Rule>;
|
|
461
|
+
oneOf(name: string): Rule<Rule>;
|
|
462
|
+
pre(): this;
|
|
463
|
+
post(): this;
|
|
464
|
+
before(name: string): this;
|
|
465
|
+
after(name: string): this;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
type RspackOptimization = Required<
|
|
469
|
+
NonNullable<Configuration['optimization']>
|
|
470
|
+
>;
|
|
471
|
+
type SplitChunksObject = Exclude<RspackOptimization['splitChunks'], false>;
|
|
472
|
+
class Optimization extends ChainedMap<Config> {
|
|
473
|
+
minimizer(name: string): Config.Plugin<this, PluginInstance>;
|
|
474
|
+
minimizers: TypedChainedMap<this, Config.Plugin<this, PluginInstance>>;
|
|
475
|
+
splitChunks: TypedChainedMap<this, SplitChunksObject> &
|
|
476
|
+
((value: SplitChunksObject | false) => this);
|
|
477
|
+
|
|
478
|
+
minimize(value: RspackOptimization['minimize']): this;
|
|
479
|
+
runtimeChunk(value: RspackOptimization['runtimeChunk']): this;
|
|
480
|
+
emitOnErrors(value: RspackOptimization['emitOnErrors']): this;
|
|
481
|
+
moduleIds(value: RspackOptimization['moduleIds']): this;
|
|
482
|
+
chunkIds(value: RspackOptimization['chunkIds']): this;
|
|
483
|
+
nodeEnv(value: RspackOptimization['nodeEnv']): this;
|
|
484
|
+
// @ts-expect-error not supported by Rspack
|
|
485
|
+
mangleWasmImports(value: RspackOptimization['mangleWasmImports']): this;
|
|
486
|
+
removeAvailableModules(
|
|
487
|
+
value: RspackOptimization['removeAvailableModules'],
|
|
488
|
+
): this;
|
|
489
|
+
removeEmptyChunks(value: RspackOptimization['removeEmptyChunks']): this;
|
|
490
|
+
mergeDuplicateChunks(
|
|
491
|
+
value: RspackOptimization['mergeDuplicateChunks'],
|
|
492
|
+
): this;
|
|
493
|
+
// @ts-expect-error not supported by Rspack
|
|
494
|
+
flagIncludedChunks(value: RspackOptimization['flagIncludedChunks']): this;
|
|
495
|
+
providedExports(value: RspackOptimization['providedExports']): this;
|
|
496
|
+
usedExports(value: RspackOptimization['usedExports']): this;
|
|
497
|
+
concatenateModules(value: RspackOptimization['concatenateModules']): this;
|
|
498
|
+
sideEffects(value: RspackOptimization['sideEffects']): this;
|
|
499
|
+
// @ts-expect-error not supported by Rspack
|
|
500
|
+
portableRecords(value: RspackOptimization['portableRecords']): this;
|
|
501
|
+
mangleExports(value: RspackOptimization['mangleExports']): this;
|
|
502
|
+
innerGraph(value: RspackOptimization['innerGraph']): this;
|
|
503
|
+
realContentHash(value: RspackOptimization['realContentHash']): this;
|
|
504
|
+
avoidEntryIife(value: RspackOptimization['avoidEntryIife']): this;
|
|
505
|
+
inlineExports(value: RspackOptimization['inlineExports']): this;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
interface RuntimeChunk {
|
|
509
|
+
name: string | RuntimeChunkFunction;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
type RuntimeChunkFunction = (entryPoint: EntryPoint) => string;
|
|
513
|
+
|
|
514
|
+
interface SplitChunksOptions {
|
|
515
|
+
[name: string]: any;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
interface LoaderOptions {
|
|
519
|
+
[name: string]: any;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
class Use<Parent = Rule> extends ChainedMap<Parent> implements Orderable {
|
|
523
|
+
loader(value: string): this;
|
|
524
|
+
options(value: LoaderOptions): this;
|
|
525
|
+
parallel(value: boolean): this;
|
|
526
|
+
|
|
527
|
+
tap(f: (options: LoaderOptions) => LoaderOptions): this;
|
|
528
|
+
|
|
529
|
+
// Orderable
|
|
530
|
+
before(name: string): this;
|
|
531
|
+
after(name: string): this;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map[-debugids].
|
|
535
|
+
export type DevTool = RspackConfig['devtool'];
|
|
536
|
+
|
|
537
|
+
interface PluginClass<PluginType extends PluginInstance | ResolvePlugin> {
|
|
538
|
+
new (...opts: any[]): PluginType;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
interface Orderable {
|
|
542
|
+
before(name: string): this;
|
|
543
|
+
after(name: string): this;
|
|
544
|
+
}
|
|
545
|
+
}
|