@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,95 @@
|
|
|
1
|
+
(*
|
|
2
|
+
Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
|
|
4
|
+
This source code is licensed under the MIT license found in the
|
|
5
|
+
LICENSE file at
|
|
6
|
+
https://github.com/facebookincubator/create-react-app/blob/master/LICENSE
|
|
7
|
+
*)
|
|
8
|
+
|
|
9
|
+
property targetTab: null
|
|
10
|
+
property targetTabIndex: -1
|
|
11
|
+
property targetWindow: null
|
|
12
|
+
property theProgram: "Google Chrome"
|
|
13
|
+
|
|
14
|
+
on run argv
|
|
15
|
+
set theURL to item 1 of argv
|
|
16
|
+
|
|
17
|
+
-- Allow requested program to be optional,
|
|
18
|
+
-- default to Google Chrome
|
|
19
|
+
if (count of argv) > 1 then
|
|
20
|
+
set theProgram to item 2 of argv
|
|
21
|
+
end if
|
|
22
|
+
|
|
23
|
+
using terms from application "Google Chrome"
|
|
24
|
+
tell application theProgram
|
|
25
|
+
|
|
26
|
+
if (count every window) = 0 then
|
|
27
|
+
make new window
|
|
28
|
+
end if
|
|
29
|
+
|
|
30
|
+
-- 1: Looking for tab running debugger
|
|
31
|
+
-- then, Reload debugging tab if found
|
|
32
|
+
-- then return
|
|
33
|
+
set found to my lookupTabWithUrl(theURL)
|
|
34
|
+
if found then
|
|
35
|
+
set targetWindow's active tab index to targetTabIndex
|
|
36
|
+
tell targetTab to reload
|
|
37
|
+
tell targetWindow to activate
|
|
38
|
+
set index of targetWindow to 1
|
|
39
|
+
return
|
|
40
|
+
end if
|
|
41
|
+
|
|
42
|
+
-- 2: Looking for Empty tab
|
|
43
|
+
-- In case debugging tab was not found
|
|
44
|
+
-- We try to find an empty tab instead
|
|
45
|
+
set found to my lookupTabWithUrl("chrome://newtab/")
|
|
46
|
+
if found then
|
|
47
|
+
set targetWindow's active tab index to targetTabIndex
|
|
48
|
+
set URL of targetTab to theURL
|
|
49
|
+
tell targetWindow to activate
|
|
50
|
+
return
|
|
51
|
+
end if
|
|
52
|
+
|
|
53
|
+
-- 3: Create new tab
|
|
54
|
+
-- both debugging and empty tab were not found
|
|
55
|
+
-- make a new tab with url
|
|
56
|
+
tell window 1
|
|
57
|
+
activate
|
|
58
|
+
make new tab with properties {URL:theURL}
|
|
59
|
+
end tell
|
|
60
|
+
end tell
|
|
61
|
+
end using terms from
|
|
62
|
+
end run
|
|
63
|
+
|
|
64
|
+
-- Function:
|
|
65
|
+
-- Lookup tab with given url
|
|
66
|
+
-- if found, store tab, index, and window in properties
|
|
67
|
+
-- (properties were declared on top of file)
|
|
68
|
+
on lookupTabWithUrl(lookupUrl)
|
|
69
|
+
using terms from application "Google Chrome"
|
|
70
|
+
tell application theProgram
|
|
71
|
+
-- Find a tab with the given url
|
|
72
|
+
set found to false
|
|
73
|
+
set theTabIndex to -1
|
|
74
|
+
repeat with theWindow in every window
|
|
75
|
+
set theTabIndex to 0
|
|
76
|
+
repeat with theTab in every tab of theWindow
|
|
77
|
+
set theTabIndex to theTabIndex + 1
|
|
78
|
+
if (theTab's URL as string) contains lookupUrl then
|
|
79
|
+
-- assign tab, tab index, and window to properties
|
|
80
|
+
set targetTab to theTab
|
|
81
|
+
set targetTabIndex to theTabIndex
|
|
82
|
+
set targetWindow to theWindow
|
|
83
|
+
set found to true
|
|
84
|
+
exit repeat
|
|
85
|
+
end if
|
|
86
|
+
end repeat
|
|
87
|
+
|
|
88
|
+
if found then
|
|
89
|
+
exit repeat
|
|
90
|
+
end if
|
|
91
|
+
end repeat
|
|
92
|
+
end tell
|
|
93
|
+
end using terms from
|
|
94
|
+
return found
|
|
95
|
+
end lookupTabWithUrl
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/// <reference types="@rspack/core/module" />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is a placeholder for extending the type options.
|
|
5
|
+
* You can augment this interface to enable stricter type checking.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* interface RsbuildTypeOptions {
|
|
9
|
+
* // This will enable strict type checking for `import.meta.env`.
|
|
10
|
+
* strictImportMetaEnv: true;
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
// biome-ignore lint/suspicious/noEmptyInterface: placeholder
|
|
15
|
+
interface RsbuildTypeOptions {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* import.meta
|
|
19
|
+
*/
|
|
20
|
+
type ImportMetaEnvFallbackKey =
|
|
21
|
+
'strictImportMetaEnv' extends keyof RsbuildTypeOptions ? never : string;
|
|
22
|
+
|
|
23
|
+
interface ImportMetaEnv extends Record<ImportMetaEnvFallbackKey, any> {
|
|
24
|
+
/**
|
|
25
|
+
* The value of the `mode` configuration.
|
|
26
|
+
* @example
|
|
27
|
+
* if (import.meta.env.MODE === 'development') {
|
|
28
|
+
* console.log('development mode');
|
|
29
|
+
* }
|
|
30
|
+
*/
|
|
31
|
+
MODE: 'development' | 'production' | 'none';
|
|
32
|
+
/**
|
|
33
|
+
* If `mode` is `'development'`, the value is `true`; otherwise, it is `false`.
|
|
34
|
+
* @example
|
|
35
|
+
* if (import.meta.env.DEV) {
|
|
36
|
+
* console.log('development mode');
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
DEV: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* If `mode` is `'production'`, the value is `true`; otherwise, it is `false`.
|
|
42
|
+
* @example
|
|
43
|
+
* if (import.meta.env.PROD) {
|
|
44
|
+
* console.log('production mode');
|
|
45
|
+
* }
|
|
46
|
+
*/
|
|
47
|
+
PROD: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The value of the `server.base` configuration.
|
|
50
|
+
* @example
|
|
51
|
+
* const image = new Image();
|
|
52
|
+
* // Equivalent to "/foo/favicon.ico"
|
|
53
|
+
* image.src = `${import.meta.env.BASE_URL}/favicon.ico`;
|
|
54
|
+
*/
|
|
55
|
+
BASE_URL: string;
|
|
56
|
+
/**
|
|
57
|
+
* The URL prefix of static assets
|
|
58
|
+
* - In development, it is equivalent to the value set by `dev.assetPrefix`.
|
|
59
|
+
* - In production, it is equivalent to the value set by `output.assetPrefix`.
|
|
60
|
+
* - Rsbuild will automatically remove the trailing slash from `assetPrefix`
|
|
61
|
+
* to make string concatenation easier.
|
|
62
|
+
* @example
|
|
63
|
+
* const image = new Image();
|
|
64
|
+
* image.src = `${import.meta.env.ASSET_PREFIX}/favicon.ico`;
|
|
65
|
+
*/
|
|
66
|
+
ASSET_PREFIX: string;
|
|
67
|
+
}
|
|
68
|
+
interface ImportMeta {
|
|
69
|
+
readonly env: ImportMetaEnv;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Image assets
|
|
74
|
+
*/
|
|
75
|
+
declare module '*.bmp' {
|
|
76
|
+
const src: string;
|
|
77
|
+
export default src;
|
|
78
|
+
}
|
|
79
|
+
declare module '*.gif' {
|
|
80
|
+
const src: string;
|
|
81
|
+
export default src;
|
|
82
|
+
}
|
|
83
|
+
declare module '*.jpg' {
|
|
84
|
+
const src: string;
|
|
85
|
+
export default src;
|
|
86
|
+
}
|
|
87
|
+
declare module '*.jpeg' {
|
|
88
|
+
const src: string;
|
|
89
|
+
export default src;
|
|
90
|
+
}
|
|
91
|
+
declare module '*.pjpeg' {
|
|
92
|
+
const src: string;
|
|
93
|
+
export default src;
|
|
94
|
+
}
|
|
95
|
+
declare module '*.pjp' {
|
|
96
|
+
const src: string;
|
|
97
|
+
export default src;
|
|
98
|
+
}
|
|
99
|
+
declare module '*.png' {
|
|
100
|
+
const src: string;
|
|
101
|
+
export default src;
|
|
102
|
+
}
|
|
103
|
+
declare module '*.ico' {
|
|
104
|
+
const src: string;
|
|
105
|
+
export default src;
|
|
106
|
+
}
|
|
107
|
+
declare module '*.webp' {
|
|
108
|
+
const src: string;
|
|
109
|
+
export default src;
|
|
110
|
+
}
|
|
111
|
+
declare module '*.svg' {
|
|
112
|
+
const src: string;
|
|
113
|
+
export default src;
|
|
114
|
+
}
|
|
115
|
+
declare module '*.apng' {
|
|
116
|
+
const src: string;
|
|
117
|
+
export default src;
|
|
118
|
+
}
|
|
119
|
+
declare module '*.avif' {
|
|
120
|
+
const src: string;
|
|
121
|
+
export default src;
|
|
122
|
+
}
|
|
123
|
+
declare module '*.tif' {
|
|
124
|
+
const src: string;
|
|
125
|
+
export default src;
|
|
126
|
+
}
|
|
127
|
+
declare module '*.tiff' {
|
|
128
|
+
const src: string;
|
|
129
|
+
export default src;
|
|
130
|
+
}
|
|
131
|
+
declare module '*.jfif' {
|
|
132
|
+
const src: string;
|
|
133
|
+
export default src;
|
|
134
|
+
}
|
|
135
|
+
declare module '*.cur' {
|
|
136
|
+
const src: string;
|
|
137
|
+
export default src;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Font assets
|
|
142
|
+
*/
|
|
143
|
+
declare module '*.woff' {
|
|
144
|
+
const src: string;
|
|
145
|
+
export default src;
|
|
146
|
+
}
|
|
147
|
+
declare module '*.woff2' {
|
|
148
|
+
const src: string;
|
|
149
|
+
export default src;
|
|
150
|
+
}
|
|
151
|
+
declare module '*.eot' {
|
|
152
|
+
const src: string;
|
|
153
|
+
export default src;
|
|
154
|
+
}
|
|
155
|
+
declare module '*.ttf' {
|
|
156
|
+
const src: string;
|
|
157
|
+
export default src;
|
|
158
|
+
}
|
|
159
|
+
declare module '*.otf' {
|
|
160
|
+
const src: string;
|
|
161
|
+
export default src;
|
|
162
|
+
}
|
|
163
|
+
declare module '*.ttc' {
|
|
164
|
+
const src: string;
|
|
165
|
+
export default src;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Media assets
|
|
170
|
+
*/
|
|
171
|
+
declare module '*.mp4' {
|
|
172
|
+
const src: string;
|
|
173
|
+
export default src;
|
|
174
|
+
}
|
|
175
|
+
declare module '*.webm' {
|
|
176
|
+
const src: string;
|
|
177
|
+
export default src;
|
|
178
|
+
}
|
|
179
|
+
declare module '*.ogg' {
|
|
180
|
+
const src: string;
|
|
181
|
+
export default src;
|
|
182
|
+
}
|
|
183
|
+
declare module '*.mp3' {
|
|
184
|
+
const src: string;
|
|
185
|
+
export default src;
|
|
186
|
+
}
|
|
187
|
+
declare module '*.wav' {
|
|
188
|
+
const src: string;
|
|
189
|
+
export default src;
|
|
190
|
+
}
|
|
191
|
+
declare module '*.flac' {
|
|
192
|
+
const src: string;
|
|
193
|
+
export default src;
|
|
194
|
+
}
|
|
195
|
+
declare module '*.aac' {
|
|
196
|
+
const src: string;
|
|
197
|
+
export default src;
|
|
198
|
+
}
|
|
199
|
+
declare module '*.mov' {
|
|
200
|
+
const src: string;
|
|
201
|
+
export default src;
|
|
202
|
+
}
|
|
203
|
+
declare module '*.m4a' {
|
|
204
|
+
const src: string;
|
|
205
|
+
export default src;
|
|
206
|
+
}
|
|
207
|
+
declare module '*.opus' {
|
|
208
|
+
const src: string;
|
|
209
|
+
export default src;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @requires [@rsbuild/plugin-yaml](https://npmjs.com/package/@rsbuild/plugin-yaml)
|
|
214
|
+
*/
|
|
215
|
+
declare module '*.yaml' {
|
|
216
|
+
const content: Record<string, any>;
|
|
217
|
+
export default content;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* @requires [@rsbuild/plugin-yaml](https://npmjs.com/package/@rsbuild/plugin-yaml)
|
|
221
|
+
*/
|
|
222
|
+
declare module '*.yml' {
|
|
223
|
+
const content: Record<string, any>;
|
|
224
|
+
export default content;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @requires [@rsbuild/plugin-toml](https://npmjs.com/package/@rsbuild/plugin-toml)
|
|
228
|
+
*/
|
|
229
|
+
declare module '*.toml' {
|
|
230
|
+
const content: Record<string, any>;
|
|
231
|
+
export default content;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Imports the file as a URL string.
|
|
236
|
+
* @note Only works for static assets by default.
|
|
237
|
+
* @example
|
|
238
|
+
* import logoUrl from './logo.png?url'
|
|
239
|
+
* console.log(logoUrl) // 'http://example.com/logo.123456.png'
|
|
240
|
+
*/
|
|
241
|
+
declare module '*?url' {
|
|
242
|
+
const content: string;
|
|
243
|
+
export default content;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Imports the file content as a base64 encoded string.
|
|
248
|
+
* @note Only works for static assets and CSS files by default.
|
|
249
|
+
* @example
|
|
250
|
+
* import logo from './logo.svg?inline'
|
|
251
|
+
* console.log(logo) // 'data:image/svg+xml;base64,...'
|
|
252
|
+
*
|
|
253
|
+
* import inlineCss from './style.css?inline';
|
|
254
|
+
* console.log(inlineCss); // Compiled CSS content
|
|
255
|
+
*/
|
|
256
|
+
declare module '*?inline' {
|
|
257
|
+
const content: string;
|
|
258
|
+
export default content;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Imports the raw content of the file as a string.
|
|
263
|
+
* @note Only works for static assets, CSS files, and scripts
|
|
264
|
+
* (JS, TS, JSX, TSX) by default.
|
|
265
|
+
* @example
|
|
266
|
+
* import raw from './logo.svg?raw'
|
|
267
|
+
* console.log(raw) // '<svg viewBox="0 0 24 24">...</svg>'
|
|
268
|
+
*
|
|
269
|
+
* import rawJs from './script.js?raw'
|
|
270
|
+
* console.log(rawJs) // 'console.log("Hello world");'
|
|
271
|
+
*
|
|
272
|
+
* import rawCss from './style.css?raw'
|
|
273
|
+
* console.log(rawCss) // 'body { background: red; }'
|
|
274
|
+
*/
|
|
275
|
+
declare module '*?raw' {
|
|
276
|
+
const content: string;
|
|
277
|
+
export default content;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* CSS Modules
|
|
282
|
+
*/
|
|
283
|
+
type CSSModuleClasses = {
|
|
284
|
+
readonly [key: string]: string;
|
|
285
|
+
};
|
|
286
|
+
declare module '*.module.css' {
|
|
287
|
+
const classes: CSSModuleClasses;
|
|
288
|
+
export default classes;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
|
|
292
|
+
*/
|
|
293
|
+
declare module '*.module.scss' {
|
|
294
|
+
const classes: CSSModuleClasses;
|
|
295
|
+
export default classes;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
|
|
299
|
+
*/
|
|
300
|
+
declare module '*.module.sass' {
|
|
301
|
+
const classes: CSSModuleClasses;
|
|
302
|
+
export default classes;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* @requires [@rsbuild/plugin-less](https://npmjs.com/package/@rsbuild/plugin-less)
|
|
306
|
+
*/
|
|
307
|
+
declare module '*.module.less' {
|
|
308
|
+
const classes: CSSModuleClasses;
|
|
309
|
+
export default classes;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
|
|
313
|
+
*/
|
|
314
|
+
declare module '*.module.styl' {
|
|
315
|
+
const classes: CSSModuleClasses;
|
|
316
|
+
export default classes;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
|
|
320
|
+
*/
|
|
321
|
+
declare module '*.module.stylus' {
|
|
322
|
+
const classes: CSSModuleClasses;
|
|
323
|
+
export default classes;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* CSS
|
|
328
|
+
*/
|
|
329
|
+
declare module '*.css' {}
|
|
330
|
+
/**
|
|
331
|
+
* @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
|
|
332
|
+
*/
|
|
333
|
+
declare module '*.scss' {}
|
|
334
|
+
/**
|
|
335
|
+
* @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
|
|
336
|
+
*/
|
|
337
|
+
declare module '*.sass' {}
|
|
338
|
+
/**
|
|
339
|
+
* @requires [@rsbuild/plugin-less](https://npmjs.com/package/@rsbuild/plugin-less)
|
|
340
|
+
*/
|
|
341
|
+
declare module '*.less' {}
|
|
342
|
+
/**
|
|
343
|
+
* @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
|
|
344
|
+
*/
|
|
345
|
+
declare module '*.styl' {}
|
|
346
|
+
/**
|
|
347
|
+
* @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
|
|
348
|
+
*/
|
|
349
|
+
declare module '*.stylus' {}
|