@ohos-ports/rsbuild-core 2.2.9-beta.0 → 2.2.13-beta.0
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 +12 -0
- package/bin/rsbuild.js +3 -1
- package/compiled/@rstackjs/load-config/package.json +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.d.ts +16 -2
- package/compiled/html-rspack-plugin/index.js +78 -28
- package/compiled/jiti/lib/jiti-cli.mjs +0 -0
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/ws/index.d.ts +4 -0
- package/compiled/ws/package.json +1 -1
- package/dist/1.js +84 -0
- package/dist/client/hmr.js +7 -2
- package/dist/client/overlay.js +9 -6
- package/dist/cssUrlLoader.mjs +18 -7
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/path.d.ts +9 -0
- package/dist/http-proxy-middleware.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/launch-editor-middleware.js +1 -1
- package/dist/loader/cssUrlLoader.d.ts +1 -0
- package/dist/m.js +446 -353
- package/dist/manifest-plugin.js +1 -1
- package/dist/memfs.js +1 -1
- package/dist/plugins/fileSize.d.ts +11 -0
- package/dist/server/assets-middleware/getFileFromUrl.d.ts +1 -0
- package/dist/server/assets-middleware/setupOutputFileSystem.d.ts +1 -2
- package/dist/server/assets-middleware/setupWriteToDisk.d.ts +19 -7
- package/dist/server/browserLogs.d.ts +5 -2
- package/dist/server/gracefulShutdown.d.ts +1 -2
- package/dist/server/helper.d.ts +2 -2
- package/dist/server/hostCheck.d.ts +7 -0
- package/dist/trace-mapping.js +16 -14
- package/dist/types/config.d.ts +21 -2
- package/dist/types/plugin.d.ts +1 -0
- package/dist/ws.js +2 -2
- package/package.json +8 -49
package/dist/1.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { isAbsolute, join, relative, sep, win32 } from "node:path";
|
|
2
|
+
let isDeno = "u" > typeof Deno, isWindows = 'win32' === process.platform, JS_DIST_DIR = 'static/js', CSS_DIST_DIR = 'static/css', SVG_DIST_DIR = 'static/svg', FONT_DIST_DIR = 'static/font', WASM_DIST_DIR = 'static/wasm', IMAGE_DIST_DIR = 'static/image', MEDIA_DIST_DIR = 'static/media', ASSETS_DIST_DIR = 'static/assets', dirname = import.meta.dirname, LOADER_PATH = dirname, STATIC_PATH = join(dirname, '../static'), CLIENT_PATH = join(dirname, 'client'), COMPILED_PATH = join(dirname, '../compiled'), TS_CONFIG_FILE = 'tsconfig.json', HMR_SOCKET_PATH = '/rsbuild-hmr', RSBUILD_OUTPUTS_PATH = '.rsbuild', LOCALHOST = 'localhost', ALL_INTERFACES_IPV4 = '0.0.0.0', DEFAULT_STACK_TRACE = 'summary', DEFAULT_WEB_BROWSERSLIST = [
|
|
3
|
+
'chrome >= 107',
|
|
4
|
+
'edge >= 107',
|
|
5
|
+
'firefox >= 104',
|
|
6
|
+
'safari >= 16'
|
|
7
|
+
], DEFAULT_BROWSERSLIST = {
|
|
8
|
+
web: DEFAULT_WEB_BROWSERSLIST,
|
|
9
|
+
'web-worker': DEFAULT_WEB_BROWSERSLIST,
|
|
10
|
+
node: [
|
|
11
|
+
'node >= 20'
|
|
12
|
+
]
|
|
13
|
+
}, JS_REGEX = /\.(?:js|mjs|cjs|jsx)$/, SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, CSS_REGEX = /\.css$/, RAW_QUERY_REGEX = /[?&]raw(?:&|=|$)/, INLINE_QUERY_REGEX = /[?&]inline(?:&|=|$)/, URL_QUERY_REGEX = /[?&]url(?:&|=|$)/, WORKER_QUERY_REGEX = /[?&]worker(?:&|=|$)/, NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/, PLUGIN_SWC_NAME = 'rsbuild:swc', PLUGIN_CSS_NAME = 'rsbuild:css', FONT_EXTENSIONS = [
|
|
14
|
+
'woff',
|
|
15
|
+
'woff2',
|
|
16
|
+
'eot',
|
|
17
|
+
'ttf',
|
|
18
|
+
'otf',
|
|
19
|
+
'ttc'
|
|
20
|
+
], ASSET_EXTENSIONS = [
|
|
21
|
+
'webmanifest',
|
|
22
|
+
'pdf',
|
|
23
|
+
'txt'
|
|
24
|
+
], IMAGE_EXTENSIONS = [
|
|
25
|
+
'png',
|
|
26
|
+
'jpg',
|
|
27
|
+
'jpeg',
|
|
28
|
+
'pjpeg',
|
|
29
|
+
'pjp',
|
|
30
|
+
'gif',
|
|
31
|
+
'bmp',
|
|
32
|
+
'webp',
|
|
33
|
+
'ico',
|
|
34
|
+
'apng',
|
|
35
|
+
'avif',
|
|
36
|
+
'tif',
|
|
37
|
+
'tiff',
|
|
38
|
+
'jfif',
|
|
39
|
+
'cur',
|
|
40
|
+
'jxl'
|
|
41
|
+
], VIDEO_EXTENSIONS = [
|
|
42
|
+
'mp4',
|
|
43
|
+
'webm',
|
|
44
|
+
'ogg',
|
|
45
|
+
'mov'
|
|
46
|
+
], AUDIO_EXTENSIONS = [
|
|
47
|
+
'mp3',
|
|
48
|
+
'wav',
|
|
49
|
+
'flac',
|
|
50
|
+
'aac',
|
|
51
|
+
'm4a',
|
|
52
|
+
'opus'
|
|
53
|
+
], TRACK_EXTENSIONS = [
|
|
54
|
+
'vtt'
|
|
55
|
+
], LAZY_COMPILATION_IDENTIFIER = 'lazy-compilation-proxy', BROWSER_LOG_PREFIX = '[browser]';
|
|
56
|
+
function toRelativePath(base, filepath) {
|
|
57
|
+
let relativePath = relative(base, filepath);
|
|
58
|
+
return '' === relativePath ? `.${sep}` : relativePath.startsWith('.') ? relativePath : `.${sep}${relativePath}`;
|
|
59
|
+
}
|
|
60
|
+
function relativeWithin(parent, target) {
|
|
61
|
+
let relativePath = relative(parent, target);
|
|
62
|
+
if (!('..' === relativePath || relativePath.startsWith(`..${sep}`) || isAbsolute(relativePath))) return relativePath;
|
|
63
|
+
}
|
|
64
|
+
function getCommonParentPath(paths) {
|
|
65
|
+
let uniquePaths = [
|
|
66
|
+
...new Set(paths)
|
|
67
|
+
];
|
|
68
|
+
if (1 === uniquePaths.length) return uniquePaths[0];
|
|
69
|
+
let [first, ...rest] = uniquePaths.map((p)=>p.split(sep)), common = [];
|
|
70
|
+
for(let i = 0; i < first.length; i++){
|
|
71
|
+
let segment = first[i];
|
|
72
|
+
if (rest.every((p)=>p[i] === segment)) common.push(segment);
|
|
73
|
+
else break;
|
|
74
|
+
}
|
|
75
|
+
return common.join(sep);
|
|
76
|
+
}
|
|
77
|
+
let getCompiledPath = (packageName)=>join(COMPILED_PATH, packageName, 'index.js'), ensureAbsolutePath = (base, filePath)=>isAbsolute(filePath) ? filePath : join(base, filePath), getPathnameFromUrl = (url)=>{
|
|
78
|
+
try {
|
|
79
|
+
return url ? new URL(url, 'http://localhost').pathname : url;
|
|
80
|
+
} catch {
|
|
81
|
+
return url;
|
|
82
|
+
}
|
|
83
|
+
}, dedupeNestedPaths = (paths)=>paths.sort((p1, p2)=>p2.length > p1.length ? -1 : 1).reduce((prev, curr)=>prev.some((p)=>void 0 !== relativeWithin(p, curr)) ? prev : prev.concat(curr), []), toPosixPath = (filepath)=>'/' === sep ? filepath : filepath.replace(/\\/g, '/'), normalizeRuleConditionPath = (filepath)=>isWindows && 'string' == typeof filepath && filepath.includes('/') && win32.isAbsolute(filepath) ? filepath.replace(/\//g, '\\') : filepath;
|
|
84
|
+
export { ALL_INTERFACES_IPV4, ASSETS_DIST_DIR, ASSET_EXTENSIONS, AUDIO_EXTENSIONS, BROWSER_LOG_PREFIX, CLIENT_PATH, COMPILED_PATH, CSS_DIST_DIR, CSS_REGEX, DEFAULT_BROWSERSLIST, DEFAULT_STACK_TRACE, DEFAULT_WEB_BROWSERSLIST, FONT_DIST_DIR, FONT_EXTENSIONS, HMR_SOCKET_PATH, IMAGE_DIST_DIR, IMAGE_EXTENSIONS, INLINE_QUERY_REGEX, JS_DIST_DIR, JS_REGEX, LAZY_COMPILATION_IDENTIFIER, LOADER_PATH, LOCALHOST, MEDIA_DIST_DIR, NODE_MODULES_REGEX, PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, RAW_QUERY_REGEX, RSBUILD_OUTPUTS_PATH, SCRIPT_REGEX, STATIC_PATH, SVG_DIST_DIR, TRACK_EXTENSIONS, TS_CONFIG_FILE, URL_QUERY_REGEX, VIDEO_EXTENSIONS, WASM_DIST_DIR, WORKER_QUERY_REGEX, dedupeNestedPaths, ensureAbsolutePath, getCommonParentPath, getCompiledPath, getPathnameFromUrl, isDeno, isWindows, normalizeRuleConditionPath, relativeWithin, toPosixPath, toRelativePath };
|
package/dist/client/hmr.js
CHANGED
|
@@ -94,7 +94,9 @@ function hmr_init(token, config, serverHost, serverPort, serverBase, liveReload,
|
|
|
94
94
|
}
|
|
95
95
|
function handleResolvedClientError({ id, message }) {
|
|
96
96
|
if (!createOverlay || hasBuildErrors) return;
|
|
97
|
-
|
|
97
|
+
const clientError = clientErrors.find((item)=>item.id === id);
|
|
98
|
+
if (!clientError) return;
|
|
99
|
+
clientError.message = message;
|
|
98
100
|
createOverlay('Runtime errors', clientErrors.map((item)=>item.message).filter(Boolean).join('\n\n'));
|
|
99
101
|
}
|
|
100
102
|
const shouldUpdate = ()=>lastHash !== import.meta.rspackHash;
|
|
@@ -145,7 +147,10 @@ function hmr_init(token, config, serverHost, serverPort, serverBase, liveReload,
|
|
|
145
147
|
switch(message.type){
|
|
146
148
|
case 'hash':
|
|
147
149
|
lastHash = message.data;
|
|
148
|
-
if (
|
|
150
|
+
if (shouldUpdate()) {
|
|
151
|
+
clientErrors.length = 0;
|
|
152
|
+
null == clearOverlay || clearOverlay();
|
|
153
|
+
}
|
|
149
154
|
break;
|
|
150
155
|
case 'ok':
|
|
151
156
|
handleSuccess();
|
package/dist/client/overlay.js
CHANGED
|
@@ -13,6 +13,12 @@ function _define_property(obj, key, value) {
|
|
|
13
13
|
const { HTMLElement: HTMLElement = class {
|
|
14
14
|
}, customElements: customElements } = "u" > typeof window ? window : globalThis;
|
|
15
15
|
class ErrorOverlay extends HTMLElement {
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
document.addEventListener('keydown', this.onEscKeydown);
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
document.removeEventListener('keydown', this.onEscKeydown);
|
|
21
|
+
}
|
|
16
22
|
init(html) {
|
|
17
23
|
var _root_querySelector, _root_querySelector1;
|
|
18
24
|
const root = this.attachShadow({
|
|
@@ -28,14 +34,11 @@ class ErrorOverlay extends HTMLElement {
|
|
|
28
34
|
}
|
|
29
35
|
e.stopPropagation();
|
|
30
36
|
});
|
|
31
|
-
const onEscKeydown = (e)=>{
|
|
32
|
-
if ('Escape' === e.key || 'Escape' === e.code) this.close();
|
|
33
|
-
document.removeEventListener('keydown', onEscKeydown);
|
|
34
|
-
};
|
|
35
|
-
document.addEventListener('keydown', onEscKeydown);
|
|
36
37
|
}
|
|
37
38
|
constructor(...args){
|
|
38
|
-
super(...args), _define_property(this, "
|
|
39
|
+
super(...args), _define_property(this, "onEscKeydown", (e)=>{
|
|
40
|
+
if ('Escape' === e.key || 'Escape' === e.code) this.close();
|
|
41
|
+
}), _define_property(this, "close", (immediate = false)=>{
|
|
39
42
|
const remove = ()=>{
|
|
40
43
|
var _this_parentNode;
|
|
41
44
|
return null == (_this_parentNode = this.parentNode) ? void 0 : _this_parentNode.removeChild(this);
|
package/dist/cssUrlLoader.mjs
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import node_path from "node:path";
|
|
2
|
+
import { relativeWithin } from "./1.js";
|
|
2
3
|
import { isCSSModules } from "./c.js";
|
|
3
|
-
let HASH_PLACEHOLDER_REGEX = /\[(?:[^:\]]+:)?(?:chunkhash|contenthash|hash|fullhash)(?::[^\]]+)?]/i, getRelativePath = (root, resourcePath)=>{
|
|
4
|
-
let relativePath =
|
|
5
|
-
if (relativePath
|
|
4
|
+
let HASH_PLACEHOLDER_REGEX = /\[(?:[^:\]]+:)?(?:chunkhash|contenthash|hash|fullhash)(?::[^\]]+)?]/i, BASE_URI = 'rsbuild-css-url://', ABSOLUTE_PUBLIC_PATH = `${BASE_URI}/public-path/`, AUTO_PUBLIC_PATH = '__rsbuild_css_url_auto_public_path__', SINGLE_DOT_PATH_SEGMENT = '__rsbuild_css_url_single_dot__', getPublicPathForExtract = (publicPath)=>/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(publicPath) ? publicPath : `${ABSOLUTE_PUBLIC_PATH}${publicPath.replaceAll('.', SINGLE_DOT_PATH_SEGMENT)}`, getRelativePath = (root, resourcePath)=>{
|
|
5
|
+
let relativePath = relativeWithin(root, resourcePath);
|
|
6
|
+
if (relativePath) return relativePath.replace(/\\/g, '/');
|
|
6
7
|
}, pitch = async function(remainingRequest) {
|
|
7
8
|
let root, resourcePath, nameSource, hash, options = this.getOptions();
|
|
8
9
|
if (isCSSModules(options.modules, this)) throw Error('[rsbuild:css] CSS Modules do not support the ?url query. Use ?inline to import the compiled CSS content as a string.');
|
|
9
|
-
let
|
|
10
|
+
let { publicPath } = this._compilation.outputOptions;
|
|
11
|
+
'auto' === publicPath && (publicPath = AUTO_PUBLIC_PATH);
|
|
12
|
+
let publicPathForExtract = 'function' == typeof publicPath ? (pathData, assetInfo)=>getPublicPathForExtract(publicPath(pathData, assetInfo)) : 'string' == typeof publicPath ? getPublicPathForExtract(publicPath) : publicPath, content = ((moduleExports)=>{
|
|
10
13
|
let content = moduleExports && 'object' == typeof moduleExports && 'default' in moduleExports ? moduleExports.default : moduleExports;
|
|
11
14
|
if ('string' != typeof content) throw Error('[rsbuild:css] Expected CSS ?url imports to export a string.');
|
|
12
15
|
return content;
|
|
13
|
-
})(await this.importModule(`!!${remainingRequest}
|
|
16
|
+
})(await this.importModule(`!!${remainingRequest}`, {
|
|
17
|
+
publicPath: publicPathForExtract,
|
|
18
|
+
baseUri: `${BASE_URI}/`
|
|
19
|
+
})).replaceAll(ABSOLUTE_PUBLIC_PATH, '').replaceAll(SINGLE_DOT_PATH_SEGMENT, '.'), ext = node_path.extname(this.resourcePath), sourceFilename = node_path.relative(this.rootContext, this.resourcePath).replace(/\\/g, '/'), name = (root = this.rootContext, resourcePath = this.resourcePath, nameSource = getRelativePath(node_path.join(root, 'src'), resourcePath) ?? getRelativePath(root, resourcePath) ?? node_path.basename(resourcePath), ext ? nameSource.slice(0, -ext.length) : nameSource), contentHash = ((hash = this.utils.createHash(this._compilation.outputOptions.hashFunction)).update(Buffer.from(content)), hash.digest(this._compilation.outputOptions.hashDigest || 'hex')), pathData = {
|
|
14
20
|
contentHash,
|
|
15
21
|
chunk: {
|
|
16
22
|
name,
|
|
@@ -21,10 +27,15 @@ let HASH_PLACEHOLDER_REGEX = /\[(?:[^:\]]+:)?(?:chunkhash|contenthash|hash|fullh
|
|
|
21
27
|
}
|
|
22
28
|
}, assetInfo = {
|
|
23
29
|
sourceFilename
|
|
24
|
-
}, filenameTemplate = 'function' == typeof options.filename ? options.filename(pathData, assetInfo) : options.filename, { path: filename, info } = this._compilation.getAssetPathWithInfo(filenameTemplate, pathData);
|
|
25
|
-
|
|
30
|
+
}, filenameTemplate = 'function' == typeof options.filename ? options.filename(pathData, assetInfo) : options.filename, { path: filename, info } = this._compilation.getAssetPathWithInfo(filenameTemplate, pathData), css = content;
|
|
31
|
+
if (publicPath === AUTO_PUBLIC_PATH) {
|
|
32
|
+
let undoPath = node_path.posix.relative(node_path.posix.dirname(filename), '.');
|
|
33
|
+
css = content.replaceAll(AUTO_PUBLIC_PATH, undoPath ? `${undoPath}/` : '');
|
|
34
|
+
}
|
|
35
|
+
return this.emitFile(filename, css, void 0, {
|
|
26
36
|
...info,
|
|
27
37
|
...assetInfo,
|
|
38
|
+
minimized: options.minimized,
|
|
28
39
|
immutable: info.immutable || HASH_PLACEHOLDER_REGEX.test(filenameTemplate)
|
|
29
40
|
}), `export default import.meta.rspackPublicPath + ${JSON.stringify(filename)};`;
|
|
30
41
|
};
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { require } from './vendors.js';
|
|
|
5
5
|
export { color, RspackChain };
|
|
6
6
|
export declare const getNodeEnv: () => string;
|
|
7
7
|
export declare const setNodeEnv: (env: string) => void;
|
|
8
|
+
export declare const isCI: () => boolean;
|
|
8
9
|
export declare const isFunction: (func: unknown) => func is (...args: any[]) => any;
|
|
9
10
|
export declare const isObject: (obj: unknown) => obj is Record<string, any>;
|
|
10
11
|
export declare const isPlainObject: (obj: unknown) => obj is Record<string, any>;
|
package/dist/helpers/path.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { Rspack } from '../types/index.js';
|
|
2
2
|
export declare function toRelativePath(base: string, filepath: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Returns `target` relative to `parent`, or `undefined` if it is outside `parent`.
|
|
5
|
+
* Returns `''` for the same directory.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* relativeWithin('/project', '/project/src'); // 'src'
|
|
9
|
+
* relativeWithin('/project', '/project'); // ''
|
|
10
|
+
* relativeWithin('/project', '/project-legacy'); // undefined
|
|
11
|
+
*/ export declare function relativeWithin(parent: string, target: string): string | undefined;
|
|
3
12
|
export declare function getCommonParentPath(paths: string[]): string;
|
|
4
13
|
export declare const getCompiledPath: (packageName: string) => string;
|
|
5
14
|
/**
|
|
@@ -11,4 +11,4 @@ import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import r
|
|
|
11
11
|
For more details, see: https://github.com/chimurai/http-proxy-middleware/issues/40
|
|
12
12
|
`,H=(e,t)=>{e.on("error",(e,t,r,o)=>{$(`httpxy error event:
|
|
13
13
|
%O`,e),"ECONNRESET"===e.code&&t&&"POST"===t.method&&"body"in t&&t.body&&console.error(i("red",O))}),e.on("proxyReq",(e,t,r)=>{r.on("error",e=>{$("Socket error in proxyReq event: \n%O",e)})}),e.on("proxyRes",(e,t,r)=>{r.on("close",()=>{r.writableEnded||($("Destroying proxyRes in proxyRes close event"),e.destroy())})}),e.on("proxyReqWs",(e,t,r)=>{r.on("error",e=>{$("Socket error in proxyReqWs event: \n%O",e)})}),e.on("open",e=>{e.on("error",e=>{$("Socket error in open event: \n%O",e)})}),e.on("close",(e,t,r)=>{t.on("error",e=>{$("Socket error in close event: \n%O",e)})}),e.on("econnreset",(e,t,r,o)=>{$(`httpxy econnreset event:
|
|
14
|
-
%O`,e)})};function T(e){return e?.replace(/[<>]/g,e=>encodeURIComponent(e))??""}let L=(e,t)=>{e.on("error",(e,t,r,o)=>{if(!t||!r)throw e;if(r&&"function"==typeof r.writeHead){if(!r.headersSent){let t=function(e){let t;if(/HPE_INVALID/.test(e))return 502;if(/HPM_ERR_INVALID_MULTIPART_/.test(e))return 400;switch(e){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":t=504;break;default:t=500}return t}(e.code);r.writeHead(t)}let o=t.headers&&t.headers.host;r.end(`Error occurred while trying to proxy: ${T(o)}${T(t.url)}`)}else!r||"function"!=typeof r.write||"writeHead"in r||r.destroy()})},I={info:()=>{},warn:()=>{},error:()=>{}},F=(e,t)=>{let r=t.logger||I;e.on("error",(e,t,o,n)=>{let s=t?.headers?.host,i=`${s}${t?.url}`,a=`${n?.href}`;r.error("[HPM] Error occurred while proxying request %s to %s [%s] (%s)",i,a,e.code||e,"https://nodejs.org/api/errors.html#errors_common_system_errors")}),e.on("proxyRes",(e,o,n)=>{let s,i=o.originalUrl??`${o.baseUrl||""}${o.url}`;try{var c;let t=(c=e.req?.agent?.sockets,Object.keys(c||{})?.[0]?.split(":")[1]),{protocol:r,host:o,path:n}=e.req;s=function({protocol:e,host:t,port:r,path:o}){let n=t?.includes(":")?`[${t}]`:t,s=new u(`${e||"undefined:"}//${n||"[::]"}`);return r&&(s.port=r),o&&(s.pathname=o),s}({protocol:r,host:o,port:t,path:n})}catch(r){console.error("[HPM] Unexpected error while creating target URL",r),(s=new a(t.target)).pathname=e.req.path}let l=s.toString(),p=`[HPM] ${o.method} ${i} -> ${l} [${e.statusCode}]`;r.info(p)}),e.on("open",e=>{r.info("[HPM] Client connected: %o",e.address())}),e.on("close",(e,t,o)=>{r.info("[HPM] Client disconnected: %o",t.address())})};function P(e){return e.name||"[anonymous Function]"}let j=S.extend("proxy-events-plugin"),N=(e,t)=>{let r;if(t.on){for(r in t.on)if(Object.prototype.hasOwnProperty.call(t.on,r)){let o=t.on[r];if(!o)continue;j(`register event handler: "${r}" -> "${P(o)}"`),e.on(r,o)}}},M=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/is-glob/4.0.3/5f6010d19ebbd407d4ddad3f32ad93b07ae9baaa0b44d778899bd947e1a7324b/node_modules/is-glob/index.js"),U=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/micromatch/4.0.8/e3e5f26f16f8b95548bbbd14ad679e23348853c21837502922840101deaebdcd/node_modules/micromatch/index.js");function B(e,t){let r=G(t);return r?.indexOf(e)===0}function D(e,t){let r=U([G(t)],e);return r&&r.length>0}function G(e){return e&&new URL(e,"http://0.0.0.0").pathname}function q(e){return"string"==typeof e&&!M(e)}function K(e){return M(e)}function W(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let Z=S.extend("path-rewriter"),z=S.extend("router");async function Q(e,t,r){let o,n=r.router;return W(n)?o=function(e,t){let r,o=e.headers.host??"",n=e.url??"";for(let[e,i]of Object.entries(t))if(V(e)){var s;if(V(s=e)&&!s.startsWith("/")){let[t,s]=function(e){let t=e.indexOf("/");return[e.slice(0,t),e.slice(t)]}(e);if(o===t&&n.startsWith(s)){z('match: "%s" -> "%s"',e,r=i);break}}else if(n.startsWith(e)){z('match: "%s" -> "%s"',e,r=i);break}}else if(e===o){z('match: "%s" -> "%s"',o,r=i);break}return r}(e,n):"function"==typeof n&&(o=await n(e,t,r)),o}function V(e){return e.indexOf("/")>-1}let X=S.extend("ipv6");function Y(e,t){var r,o,n;let s="string"==typeof(r=e)?new URL(r):r instanceof URL?r:void 0;if(s&&(o=s.hostname).startsWith("[")&&o.endsWith("]")){let r="::"===(n=s.hostname.replace(/^\[|\]$/g,""))?(X("normalizing hostname unspecified IPv6 address (::) to loopback (::1)"),"::1"):n;return X('normalized IPv6 "%s" %s',t,e),{hostname:r,auth:s.username||s.password?`${s.username}:${s.password}`:void 0,pathname:s.pathname,port:s.port,protocol:s.protocol,search:s.search}}return e}class J{wsInternalSubscribedServers=new WeakSet;activeServers=new Set;proxyOptions;proxy;pathRewriter;logger;constructor(e){if(!e.target&&!e.router)throw new k('[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',"ERR_CONFIG_FACTORY_TARGET_MISSING");this.proxyOptions=e,this.logger=e.logger||I,S("create proxy server"),this.proxy=function(e={}){return new w(e)}({}),this.registerPlugins(this.proxy,this.proxyOptions),this.pathRewriter=function(e){let t;if(function(e){if("function"==typeof e)return!0;if(W(e))return 0!==Object.keys(e).length;if(null==e)return!1;throw new k("[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function","HPM_INVALID_PATH_REWRITER_CONFIG")}(e))if("function"==typeof e)return e;else return t=function(e){let t=[];if(W(e))for(let[r,o]of Object.entries(e))t.push({regex:new RegExp(r),value:o}),Z('rewrite rule created: "%s" ~> "%s"',r,o);return t}(e),function(e){let r=e;for(let o of t)if(o.regex.test(e)){Z('rewriting path from "%s" to "%s"',e,r=r.replace(o.regex,o.value));break}return r}}(this.proxyOptions.pathRewrite),this.middleware.upgrade=(e,t,r)=>{let o=this.#e(e);o&&!this.wsInternalSubscribedServers.has(o)&&this.handleUpgrade(e,t,r)}}#e(e){return e.socket?.server}middleware=async(e,t,r)=>{if(this.shouldProxy(this.proxyOptions.pathFilter,e)){let o;try{if(!(o=await this.prepareProxyRequest(e,t)).target&&!o.forward)throw Error("Must provide a proper URL as target")}catch(e){r?.(e);return}try{S("proxy request to target: %O",o.target),await this.proxy.web(e,t,o)}catch(n){this.proxy.emit("error",n,e,t,o.target),r?.(n)}}else r?.();let o=this.#e(e);o&&!this.activeServers.has(o)&&(S("registering server close listener"),this.activeServers.add(o),o.on("close",()=>{(S("server close signal received."),this.activeServers.delete(o),this.activeServers.size>0)?S(`proxy server not closed: ${this.activeServers.size} server(s) still active`):(S("closing proxy server"),this.proxy.close(()=>S("proxy server closed")))})),!0===this.proxyOptions.ws&&o&&this.catchUpgradeRequest(o)};registerPlugins(e,t){let r;(r=t.on?.error?[]:[L],
|
|
14
|
+
%O`,e)})};function T(e){return e?.replace(/[<>]/g,e=>encodeURIComponent(e))??""}let L=(e,t)=>{e.on("error",(e,t,r,o)=>{if(!t||!r)throw e;if(r&&"function"==typeof r.writeHead){if(!r.headersSent){let t=function(e){let t;if(/HPE_INVALID/.test(e))return 502;if(/HPM_ERR_INVALID_MULTIPART_/.test(e))return 400;switch(e){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":t=504;break;default:t=500}return t}(e.code);r.writeHead(t)}let o=t.headers&&t.headers.host;r.end(`Error occurred while trying to proxy: ${T(o)}${T(t.url)}`)}else!r||"function"!=typeof r.write||"writeHead"in r||r.destroy()})},I={info:()=>{},warn:()=>{},error:()=>{}},F=(e,t)=>{let r=t.logger||I;e.on("error",(e,t,o,n)=>{let s=t?.headers?.host,i=`${s}${t?.url}`,a=`${n?.href}`;r.error("[HPM] Error occurred while proxying request %s to %s [%s] (%s)",i,a,e.code||e,"https://nodejs.org/api/errors.html#errors_common_system_errors")}),e.on("proxyRes",(e,o,n)=>{let s,i=o.originalUrl??`${o.baseUrl||""}${o.url}`;try{var c;let t=(c=e.req?.agent?.sockets,Object.keys(c||{})?.[0]?.split(":")[1]),{protocol:r,host:o,path:n}=e.req;s=function({protocol:e,host:t,port:r,path:o}){let n=t?.includes(":")?`[${t}]`:t,s=new u(`${e||"undefined:"}//${n||"[::]"}`);return r&&(s.port=r),o&&(s.pathname=o),s}({protocol:r,host:o,port:t,path:n})}catch(r){console.error("[HPM] Unexpected error while creating target URL",r),(s=new a(t.target)).pathname=e.req.path}let l=s.toString(),p=`[HPM] ${o.method} ${i} -> ${l} [${e.statusCode}]`;r.info(p)}),e.on("open",e=>{r.info("[HPM] Client connected: %o",e.address())}),e.on("close",(e,t,o)=>{r.info("[HPM] Client disconnected: %o",t.address())})};function P(e){return e.name||"[anonymous Function]"}let j=S.extend("proxy-events-plugin"),N=(e,t)=>{let r;if(t.on){for(r in t.on)if(Object.prototype.hasOwnProperty.call(t.on,r)){let o=t.on[r];if(!o)continue;j(`register event handler: "${r}" -> "${P(o)}"`),e.on(r,o)}}},M=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/is-glob/4.0.3/5f6010d19ebbd407d4ddad3f32ad93b07ae9baaa0b44d778899bd947e1a7324b/node_modules/is-glob/index.js"),U=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/micromatch/4.0.8/e3e5f26f16f8b95548bbbd14ad679e23348853c21837502922840101deaebdcd/node_modules/micromatch/index.js");function B(e,t){let r=G(t);return r?.indexOf(e)===0}function D(e,t){let r=U([G(t)],e);return r&&r.length>0}function G(e){return e&&new URL(e,"http://0.0.0.0").pathname}function q(e){return"string"==typeof e&&!M(e)}function K(e){return M(e)}function W(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let Z=S.extend("path-rewriter"),z=S.extend("router");async function Q(e,t,r){let o,n=r.router;return W(n)?o=function(e,t){let r,o=e.headers.host??"",n=e.url??"";for(let[e,i]of Object.entries(t))if(V(e)){var s;if(V(s=e)&&!s.startsWith("/")){let[t,s]=function(e){let t=e.indexOf("/");return[e.slice(0,t),e.slice(t)]}(e);if(o===t&&n.startsWith(s)){z('match: "%s" -> "%s"',e,r=i);break}}else if(n.startsWith(e)){z('match: "%s" -> "%s"',e,r=i);break}}else if(e===o){z('match: "%s" -> "%s"',o,r=i);break}return r}(e,n):"function"==typeof n&&(o=await n(e,t,r)),o}function V(e){return e.indexOf("/")>-1}let X=S.extend("ipv6");function Y(e,t){var r,o,n;let s="string"==typeof(r=e)?new URL(r):r instanceof URL?r:void 0;if(s&&(o=s.hostname).startsWith("[")&&o.endsWith("]")){let r="::"===(n=s.hostname.replace(/^\[|\]$/g,""))?(X("normalizing hostname unspecified IPv6 address (::) to loopback (::1)"),"::1"):n;return X('normalized IPv6 "%s" %s',t,e),{hostname:r,auth:s.username||s.password?`${s.username}:${s.password}`:void 0,pathname:s.pathname,port:s.port,protocol:s.protocol,search:s.search}}return e}class J{wsInternalSubscribedServers=new WeakSet;activeServers=new Set;proxyOptions;proxy;pathRewriter;logger;constructor(e){if(!e.target&&!e.router)throw new k('[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',"ERR_CONFIG_FACTORY_TARGET_MISSING");this.proxyOptions=e,this.logger=e.logger||I,S("create proxy server"),this.proxy=function(e={}){return new w(e)}({}),this.registerPlugins(this.proxy,this.proxyOptions),this.pathRewriter=function(e){let t;if(function(e){if("function"==typeof e)return!0;if(W(e))return 0!==Object.keys(e).length;if(null==e)return!1;throw new k("[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function","HPM_INVALID_PATH_REWRITER_CONFIG")}(e))if("function"==typeof e)return e;else return t=function(e){let t=[];if(W(e))for(let[r,o]of Object.entries(e))t.push({regex:new RegExp(r),value:o}),Z('rewrite rule created: "%s" ~> "%s"',r,o);return t}(e),function(e){let r=e;for(let o of t)if(o.regex.test(e)){Z('rewriting path from "%s" to "%s"',e,r=r.replace(o.regex,o.value));break}return r}}(this.proxyOptions.pathRewrite),this.middleware.upgrade=(e,t,r)=>{let o=this.#e(e);o&&!this.wsInternalSubscribedServers.has(o)&&this.handleUpgrade(e,t,r)}}#e(e){return e.socket?.server}middleware=async(e,t,r)=>{if(this.shouldProxy(this.proxyOptions.pathFilter,e)){let o;try{if(!(o=await this.prepareProxyRequest(e,t)).target&&!o.forward)throw Error("Must provide a proper URL as target")}catch(e){r?.(e);return}try{S("proxy request to target: %O",o.target),await this.proxy.web(e,t,o)}catch(n){this.proxy.emit("error",n,e,t,o.target),r?.(n)}}else r?.();let o=this.#e(e);o&&!this.activeServers.has(o)&&(S("registering server close listener"),this.activeServers.add(o),o.on("close",()=>{(S("server close signal received."),this.activeServers.delete(o),this.activeServers.size>0)?S(`proxy server not closed: ${this.activeServers.size} server(s) still active`):(S("closing proxy server"),this.proxy.close(()=>S("proxy server closed")))})),!0===this.proxyOptions.ws&&o&&this.catchUpgradeRequest(o)};registerPlugins(e,t){let r,o,n;(r=t.on?.error?[]:[L],o=t.ejectPlugins?[]:[H,N,F,...r],n=t.plugins??[],[...o,...n]).forEach(r=>{S(`register plugin: "${P(r)}"`),r(e,t)})}catchUpgradeRequest=e=>{this.wsInternalSubscribedServers.has(e)||(S("subscribing to server upgrade event"),e.on("upgrade",this.handleUpgrade),this.wsInternalSubscribedServers.add(e))};handleUpgrade=async(e,t,r)=>{try{if(this.shouldProxy(this.proxyOptions.pathFilter,e)){let o=await this.prepareProxyRequest(e,void 0);await this.proxy.ws(e,t,o,r),S("server upgrade event received. Proxying WebSocket")}}catch(r){this.proxy.emit("error",r,e,t)}};shouldProxy=(e,t)=>{try{return function(e="/",t,r){if(q(e))return B(e,t);if(K(e))return D(e,t);if(Array.isArray(e)){if(e.every(q)){var o,n,s=e,i=t;let r=!1;for(let e of s)if(B(e,i)){r=!0;break}return r}if(e.every(K)){return o=e,n=t,D(o,n)}throw new k('[HPM] Invalid pathFilter. Plain paths (e.g. "/api") can not be mixed with globs (e.g. "/api/**"). Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"].',"HPM_INVALID_PATH_FILTER_ARRAY_CONFIG")}if("function"==typeof e)return!!e(G(t),r);throw new k('[HPM] Invalid pathFilter. Expecting something like: "/api" or ["/api", "/ajax"]',"HPM_INVALID_PATH_FILTER_CONFIG")}(e,t.url,t)}catch(e){return S("Error: matchPathFilter() called with request url: ",`"${t.url}"`),this.logger.error(e),!1}};prepareProxyRequest=async(e,t)=>{let r=Object.assign({},this.proxyOptions);return await this.applyRouter(e,t,r),r.target=Y(r.target,"target"),r.forward=Y(r.forward,"forward"),await this.applyPathRewrite(e,t,this.pathRewriter,r),r};applyRouter=async(e,t,r)=>{let o;r.router&&(o=await Q(e,t,r))&&(S('router new target: "%s"',o),r.target=o)};applyPathRewrite=async(e,t,r,o)=>{if(e.url&&r){let n=await r(e.url,e,t,o);"string"==typeof n?(S("pathRewrite new path: %s",n),e.url=n):S("pathRewrite: no rewritten path found: %s",e.url)}}}function ee(e){let{middleware:t}=new J(e);return t}S.extend("response-interceptor");export{ee as createProxyMiddleware};
|
package/dist/index.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ export type { HotClient, HotOnConnect, RsbuildDevServer } from './server/devServ
|
|
|
25
25
|
export type { RsbuildServerBase, ServerStartResult, StartDevServerResult, StartPreviewServerResult } from './server/helper.js';
|
|
26
26
|
export type { RsbuildPreviewServer } from './server/previewServer.js';
|
|
27
27
|
// Types
|
|
28
|
-
export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OnRestartFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, ReadonlyRoutes, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RestartContext, RestartFn, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFileEvent, WatchFiles, WebSocketUrlResolver } from './types/index.js';
|
|
28
|
+
export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OnRestartFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, ReadonlyRoutes, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RestartContext, RestartFn, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMiddlewares, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildServerResponse, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFileEvent, WatchFiles, WebSocketUrlResolver } from './types/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME
|
|
1
|
+
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME } from "./1.js";
|
|
2
|
+
export { createLogger, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./m.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import{createRequire as n}from"node:module";let o=n(import.meta.url);t.add({"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor-middleware/2.14.1/6d555a60526ad6844dc2673e73b564ffd44ca896ac31b809c7cc243f8e135c00/node_modules/launch-editor-middleware/index.js"(t){let n=o("path"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/index.js");t.exports=(e,t,o)=>("function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),t=t||process.cwd(),function(s,a){let r;try{let e=s.url.startsWith("http")?s.url:`http://localhost${s.url}`;r=new URL(e)}catch(e){a.statusCode=500,a.end("launch-editor-middleware: invalid URL.");return}let c=r.searchParams.get("file");c?(i(c.startsWith("file://")?c:n.resolve(t,c),e,o),a.end()):(a.statusCode=500,a.end('launch-editor-middleware: required query param "file" is missing.'))})},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/linux.js"(e){e.exports={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",cursor:"cursor",trae:"trae",antigravity:"antigravity",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider",zed:"zed"}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/macos.js"(e){e.exports={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Code":"code","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders":"code-insiders","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/Trae.app/Contents/MacOS/Electron":"trae","/Applications/Antigravity.app/Contents/MacOS/Electron":"antigravity","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider","/Applications/Zed.app/Contents/MacOS/zed":"zed"}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/windows.js"(e){e.exports=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","Cursor.exe","atom.exe","sublime_text.exe","notepad++.exe","clion.exe","clion64.exe","idea.exe","idea64.exe","phpstorm.exe","phpstorm64.exe","pycharm.exe","pycharm64.exe","rubymine.exe","rubymine64.exe","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe","Trae.exe","zed.exe","Antigravity.exe"]},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/get-args.js"(e){let t=o("path");e.exports=function(e,n,o,i=1){switch(t.basename(e).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${n}:${o}:${i}`];case"notepad++":return["-n"+o,"-c"+i,n];case"vim":case"mvim":return[`+call cursor(${o}, ${i})`,n];case"joe":case"gvim":return[`+${o}`,n];case"emacs":case"emacsclient":return[`+${o}:${i}`,n];case"rmate":case"mate":case"mine":return["--line",o,n];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"trae":case"antigravity":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${n}:${o}:${i}`];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return["--line",o,"--column",i,n]}return process.env.LAUNCH_EDITOR?[n,o,i]:[n]}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/guess.js"(t){let n=o("path"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/index.js"),s=o("child_process"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/macos.js"),r=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/linux.js"),c=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/windows.js");function p(e){let t=Object.keys(a),n=e.split("\n");for(let o=0;o<t.length;o++){let i=t[o];if(n.includes(i))return a[i];let s=i.replace("/Applications","");if(-1!==e.indexOf(s)){if(i!==a[i])return a[i];let e=n.find(e=>e.endsWith(s));if(void 0!==e)return e}}}function l(e){let t=e.split("\r\n");for(let e=0;e<t.length;e++){let o=t[e].trim(),i=n.win32.basename(o);if(-1!==c.indexOf(i))return o}}function d(e){let t=Object.keys(r);for(let n=0;n<t.length;n++){let o=t[n];if(-1!==e.indexOf(o))return r[o]}}t.exports=function(e){if(e)return i.parse(e);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if("darwin"===process.platform){let e=s.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),t=p(e);if(void 0!==t)return[t]}else if("win32"===process.platform){let e=s.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString(),t=l(e);if(void 0!==t)return[t]}else if("linux"===process.platform){let e=s.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),t=d(e);if(void 0!==t)return[t]}}catch(e){}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]},t.exports.getEditorFromMacProcesses=p,t.exports.getEditorFromWindowsProcesses=l,t.exports.getEditorFromLinuxProcesses=d},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/index.js"(t){let n=o("fs"),i=o("os"),s=o("path"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/picocolors/1.1.1/a2cca8821324d9b53ce284317d33c07b8ca7ab5b808164538a24d91cf6e92abb/node_modules/picocolors/picocolors.js"),r=o("child_process"),c=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/guess.js"),p=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/get-args.js"),l=/:(\d+)(:(\d+))?$/,d=null;t.exports=function(e,t,m){var u,b;let h,f,x=((u=e).startsWith("file://")&&(u=o("url").fileURLToPath(u)),h=u.replace(l,""),{fileName:h,lineNumber:(f=u.match(l))&&f[1],columnNumber:f&&f[3]}),{fileName:g}=x,{lineNumber:v,columnNumber:C}=x;if("win32"===process.platform&&s.resolve(g).startsWith("\\\\"))return m(g,"UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");if(!n.existsSync(g))return;"function"==typeof t&&(m=t,t=void 0),b=m,m=(e,t)=>{console.log(),console.log(a.red("Could not open "+s.basename(e)+" in the editor.")),t&&("."!==t[t.length-1]&&(t+="."),console.log(a.red("The editor process exited with an error: "+t))),console.log(),b&&b(e,t)};let[S,...A]=c(t);if(!S)return void m(g,null);if("linux"===process.platform&&g.startsWith("/mnt/")&&/Microsoft/i.test(i.release())&&(g=s.relative("",g)),v){let e=p(S,g,v,C);A.push.apply(A,e)}else A.push(g);if(d&&function(e){switch(e){case"vim":case"emacs":case"nano":return!0}return!1}(S)&&d.kill("SIGKILL"),"win32"===process.platform){let e=[S,...A.map(function(e){return e.replace(/([&|<>,;=^])/g,"^$1")})].map(function(e){return e.includes("^")?`^"${e}^"`:e.includes(" ")?`"${e}"`:e}).join(" ");d=r.exec(e,{stdio:"inherit",shell:!0})}else d=r.spawn(S,A,{stdio:"inherit"});d.on("exit",function(e){d=null,e&&m(g,"(code "+e+")")}),d.on("error",function(e){let{code:t,message:n}=e;"ENOENT"===t&&(n=`${n} ('${S}' command does not exist in 'PATH')`),m(g,n)})}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/picocolors/1.1.1/a2cca8821324d9b53ce284317d33c07b8ca7ab5b808164538a24d91cf6e92abb/node_modules/picocolors/picocolors.js"(e){let t=process||{},n=t.argv||[],o=t.env||{},i=!(o.NO_COLOR||n.includes("--no-color"))&&(!!o.FORCE_COLOR||n.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==o.TERM||!!o.CI),s=(e,t,n=e)=>o=>{let i=""+o,s=i.indexOf(t,e.length);return~s?e+a(i,t,n,s)+t:e+i+t},a=(e,t,n,o)=>{let i="",s=0;do i+=e.substring(s,o)+n,s=o+t.length,o=e.indexOf(t,s);while(~o);return i+e.substring(s)},r=(e=i)=>{let t=e?s:()=>String;return{isColorSupported:e,reset:t("\x1b[0m","\x1b[0m"),bold:t("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),dim:t("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),italic:t("\x1b[3m","\x1b[23m"),underline:t("\x1b[4m","\x1b[24m"),inverse:t("\x1b[7m","\x1b[27m"),hidden:t("\x1b[8m","\x1b[28m"),strikethrough:t("\x1b[9m","\x1b[29m"),black:t("\x1b[30m","\x1b[39m"),red:t("\x1b[31m","\x1b[39m"),green:t("\x1b[32m","\x1b[39m"),yellow:t("\x1b[33m","\x1b[39m"),blue:t("\x1b[34m","\x1b[39m"),magenta:t("\x1b[35m","\x1b[39m"),cyan:t("\x1b[36m","\x1b[39m"),white:t("\x1b[37m","\x1b[39m"),gray:t("\x1b[90m","\x1b[39m"),bgBlack:t("\x1b[40m","\x1b[49m"),bgRed:t("\x1b[41m","\x1b[49m"),bgGreen:t("\x1b[42m","\x1b[49m"),bgYellow:t("\x1b[43m","\x1b[49m"),bgBlue:t("\x1b[44m","\x1b[49m"),bgMagenta:t("\x1b[45m","\x1b[49m"),bgCyan:t("\x1b[46m","\x1b[49m"),bgWhite:t("\x1b[47m","\x1b[49m"),blackBright:t("\x1b[90m","\x1b[39m"),redBright:t("\x1b[91m","\x1b[39m"),greenBright:t("\x1b[92m","\x1b[39m"),yellowBright:t("\x1b[93m","\x1b[39m"),blueBright:t("\x1b[94m","\x1b[39m"),magentaBright:t("\x1b[95m","\x1b[39m"),cyanBright:t("\x1b[96m","\x1b[39m"),whiteBright:t("\x1b[97m","\x1b[39m"),bgBlackBright:t("\x1b[100m","\x1b[49m"),bgRedBright:t("\x1b[101m","\x1b[49m"),bgGreenBright:t("\x1b[102m","\x1b[49m"),bgYellowBright:t("\x1b[103m","\x1b[49m"),bgBlueBright:t("\x1b[104m","\x1b[49m"),bgMagentaBright:t("\x1b[105m","\x1b[49m"),bgCyanBright:t("\x1b[106m","\x1b[49m"),bgWhiteBright:t("\x1b[107m","\x1b[49m")}};e.exports=r(),e.exports.createColors=r},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/index.js"(t,n){e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/quote.js"),n.parse=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/parse.js")},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/parse.js"(e){for(var t="(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])",n=RegExp("^"+t+"$"),o="|&;()<> \\t",i=/^#$/,s="",a=0;a<4;a++)s+=(0x100000000*Math.random()).toString(16);var r=RegExp("^"+s);e.exports=function(e,a,c){var p=function(e,a,r){r||(r={});var c=r.escape||"\\",p=!0===r.splitUnquoted?" \n":"string"==typeof r.splitUnquoted?r.splitUnquoted:"",l=function(e,t){for(var n,o=t.lastIndex,i=[];n=t.exec(e);)i[i.length]=n,t.lastIndex===n.index&&(t.lastIndex+=1);return t.lastIndex=o,i}(e,RegExp(["("+t+")","("+("(\\"+c+"['\""+o+"]|[^\\s'\""+o)+'])+|"((\\\\"|[^"])*?)"|\'([^\']*?)\')+'].join("|"),"g"));if(0===l.length)return[];a||(a={});var d=!1;return l.map(function(t){var o,r=t[0];if(r&&!d){if(n.test(r))return{op:r};var l=!1,m=!1,u="",b=[],h=!1,f=null,x=!1;for(o=0;o<r.length;o++){var g=r.charAt(o);if(p&&"$"!==g&&_(),x=x||!l&&("*"===g||"?"===g),m)u+=g,m=!1;else if(l)g===l?l=!1:"'"==l?u+=g:g===c?(o+=1,'"'===(g=r.charAt(o))||g===c||"$"===g?u+=g:u+=c+g):"$"===g?u+=O():u+=g;else if('"'===g||"'"===g)l=g,h=!0;else if(n.test(g))return{op:r};else if(i.test(g)){d=!0;var v={comment:e.slice(t.index+o+1)};if(u.length)return[u,v];return[v]}else if(g===c)m=!0;else if("$"===g){var C=O();if(p)for(var S=0;S<C.length;S+=1){var A=C.charAt(S);0>p.indexOf(A)?(_(),u+=A):null===f?f=+(" "!==A&&" "!==A&&"\n"!==A):" "!==A&&" "!==A&&"\n"!==A&&(f+=1)}else u+=C}else u+=g}if(x)return{op:"glob",pattern:u};if(p){if(null!==f&&f>0){b[b.length]=u,u="";for(var y=1;y<f;y+=1)b[b.length]=""}return(""!==u||h&&0===b.length)&&(b[b.length]=u),b}return u}function O(){o+=1;var e,t,n,i,c,p=r.charAt(o);if("{"===p){if(o+=1,"}"===r.charAt(o))throw Error("Bad substitution: "+r.slice(o-2,o+1));var l=1;for(i=o;l>0&&i<r.length;)"{"===r.charAt(i)&&"$"===r.charAt(i-1)?l+=1:"}"===r.charAt(i)&&(l-=1),i+=1;if(0!==l)throw Error("Bad substitution: "+r.slice(o));i-=1,c=r.slice(o,i),o=i}else if(/[*@#?$!_-]/.test(p))c=p,o+=1;else{var d=r.slice(o);(i=d.match(/[^\w\d_]/))?(c=d.slice(0,i.index),o+=i.index-1):(c=d,o=r.length)}return e=a,t=c,(void 0===(n="function"==typeof e?e(t):e[t])&&""!=t?n="":void 0===n&&(n="$"),"object"==typeof n)?""+s+JSON.stringify(n)+s:""+n}function _(){if(null!==f){if(0===f)""!==u&&(b[b.length]=u,u="");else{b[b.length]=u,u="";for(var e=1;e<f;e+=1)b[b.length]=""}f=null}}}).reduce(function(e,t){return void 0===t||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}(e,a,c);return"function"!=typeof a?p:p.reduce(function(e,t){if("object"==typeof t)return e[e.length]=t,e;var n=t.split(RegExp("("+s+".*?"+s+")","g"));return 1===n.length?e[e.length]=n[0]:n.filter(Boolean).forEach(function(t){e[e.length]=r.test(t)?JSON.parse(t.split(s)[1]):t}),e},[])}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/quote.js"(e){var t=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],n=/[\n\r\u2028\u2029]/,o=/[\s#!"$&'():;<=>@\\^`|]/g;e.exports=function(e){return e.map(function(e){if(""===e)return"''";if(e&&"object"==typeof e){if("op"in e&&"glob"===e.op){if("string"!=typeof e.pattern)throw TypeError("glob token requires a string `pattern`");if(n.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(o,"\\$&")}if("op"in e&&"string"==typeof e.op){if(0>t.indexOf(e.op))throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,"\\$&")}if("comment"in e&&"string"==typeof e.comment){if(n.test(e.comment))throw TypeError("`comment` must not contain line terminators");return"#"+e.comment}throw TypeError("unrecognized object token shape")}return/["\s\\]/.test(e)&&!/'/.test(e)?"'"+e.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(e)?'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"':String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}}}),e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor-middleware/2.14.1/6d555a60526ad6844dc2673e73b564ffd44ca896ac31b809c7cc243f8e135c00/node_modules/launch-editor-middleware/index.js");
|
|
1
|
+
import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import{createRequire as n}from"node:module";let o=n(import.meta.url);t.add({"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor-middleware/2.14.2/46c81dbb0ad4cd8f776539a7cfaa5ea6144007363b919f05970ca6624282dcce/node_modules/launch-editor-middleware/index.js"(t){let n=o("path"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/index.js");t.exports=(e,t,o)=>("function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),t=t||process.cwd(),function(s,a){let r;try{let e=s.url.startsWith("http")?s.url:`http://localhost${s.url}`;r=new URL(e)}catch(e){a.statusCode=500,a.end("launch-editor-middleware: invalid URL.");return}let c=r.searchParams.get("file");c?(i(c.startsWith("file://")?c:n.resolve(t,c),e,o),a.end()):(a.statusCode=500,a.end('launch-editor-middleware: required query param "file" is missing.'))})},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/construct-windows-launch-command.js"(e){function t(e){return e.replace(/([&|<>,;=^])/g,"^$1")}function n(e){return e.includes("^")?`^"${e}^"`:e.includes(" ")?`"${e}"`:e}e.exports=function(e,o){if(o.some(e=>/[\r\n]/.test(e)))throw Error("Cannot launch an editor with an argument containing a line break");if(o.some(e=>e.includes("%")))throw Error('Cannot launch an editor with an argument containing "%"');return[e,...o.map(t)].map(n).join(" ")}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/editor-info/linux.js"(e){e.exports={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",cursor:"cursor",trae:"trae",antigravity:"antigravity",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider",zed:"zed"}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/editor-info/macos.js"(e){e.exports={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Code":"code","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders":"code-insiders","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/Trae.app/Contents/MacOS/Electron":"trae","/Applications/Antigravity.app/Contents/MacOS/Electron":"antigravity","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider","/Applications/Zed.app/Contents/MacOS/zed":"zed"}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/editor-info/windows.js"(e){e.exports=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","Cursor.exe","atom.exe","sublime_text.exe","notepad++.exe","clion.exe","clion64.exe","idea.exe","idea64.exe","phpstorm.exe","phpstorm64.exe","pycharm.exe","pycharm64.exe","rubymine.exe","rubymine64.exe","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe","Trae.exe","zed.exe","Antigravity.exe"]},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/get-args.js"(e){let t=o("os"),n=o("path");e.exports=function(e,o,i,s=1){if(o=n.resolve(o),"linux"===process.platform&&o.startsWith("/mnt/")&&/Microsoft/i.test(t.release())&&(o=`./${n.relative("",o)}`),!i)return[o];switch(n.basename(e).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${o}:${i}:${s}`];case"notepad++":return["-n"+i,"-c"+s,o];case"vim":case"mvim":return[`+call cursor(${i}, ${s})`,o];case"joe":case"gvim":return[`+${i}`,o];case"emacs":case"emacsclient":return[`+${i}:${s}`,o];case"rmate":case"mate":case"mine":return["--line",i,o];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"trae":case"antigravity":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${o}:${i}:${s}`];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return["--line",i,"--column",s,o]}return process.env.LAUNCH_EDITOR?[o,i,s]:[o]}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/guess.js"(t){let n=o("path"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/index.js"),s=o("child_process"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/editor-info/macos.js"),r=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/editor-info/linux.js"),c=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/editor-info/windows.js");function l(e){let t=Object.keys(a),n=e.split("\n");for(let o=0;o<t.length;o++){let i=t[o];if(n.includes(i))return a[i];let s=i.replace("/Applications","");if(-1!==e.indexOf(s)){if(i!==a[i])return a[i];let e=n.find(e=>e.endsWith(s));if(void 0!==e)return e}}}function p(e){let t=e.split("\r\n");for(let e=0;e<t.length;e++){let o=t[e].trim(),i=n.win32.basename(o);if(-1!==c.indexOf(i))return o}}function d(e){let t=Object.keys(r);for(let n=0;n<t.length;n++){let o=t[n];if(-1!==e.indexOf(o))return r[o]}}t.exports=function(e){if(e)return i.parse(e);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if("darwin"===process.platform){let e=s.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),t=l(e);if(void 0!==t)return[t]}else if("win32"===process.platform){let e=s.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString(),t=p(e);if(void 0!==t)return[t]}else if("linux"===process.platform){let e=s.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),t=d(e);if(void 0!==t)return[t]}}catch(e){}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]},t.exports.getEditorFromMacProcesses=l,t.exports.getEditorFromWindowsProcesses=p,t.exports.getEditorFromLinuxProcesses=d},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/index.js"(t){let n=o("fs"),i=o("path"),s=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/picocolors/1.1.1/a2cca8821324d9b53ce284317d33c07b8ca7ab5b808164538a24d91cf6e92abb/node_modules/picocolors/picocolors.js"),a=o("child_process"),r=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/guess.js"),c=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/get-args.js"),l=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/construct-windows-launch-command.js"),p=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/parse-file.js"),d=null;t.exports=function(e,t,o){var u;let m,{fileName:b,lineNumber:f,columnNumber:h}=p(e);if("function"==typeof t&&(o=t,t=void 0),u=o,o=(e,t)=>{console.log(),console.log(s.red("Could not open "+i.basename(e)+" in the editor.")),t&&("."!==t[t.length-1]&&(t+="."),console.log(s.red("The editor process exited with an error: "+t))),console.log(),u&&u(e,t)},"win32"===process.platform&&b.startsWith("\\\\"))return o(b,"UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");if(!n.existsSync(b))return;let[x,...g]=r(t);if(!x)return void o(b,null);let v=c(x,b,f,h);if(g.push.apply(g,v),"win32"===process.platform)try{m=l(x,g)}catch(e){o(b,e.message);return}d&&function(e){switch(e){case"vim":case"emacs":case"nano":return!0}return!1}(x)&&d.kill("SIGKILL"),(d="win32"===process.platform?a.exec(m,{stdio:"inherit",shell:!0}):a.spawn(x,g,{stdio:"inherit"})).on("exit",function(e){d=null,e&&o(b,"(code "+e+")")}),d.on("error",function(e){let{code:t,message:n}=e;"ENOENT"===t&&(n=`${n} ('${x}' command does not exist in 'PATH')`),o(b,n)})}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.2/33c7233605fa0b95a07569e7b4eb5410916ef2230059874c384dd35764dafb35/node_modules/launch-editor/parse-file.js"(e){let t=o("path"),n=/:(\d+)(:(\d+))?$/;e.exports=function(e){e.startsWith("file://")&&(e=o("url").fileURLToPath(e));let i=e.replace(n,""),s=i?t.resolve(i):"",a=e.match(n);return{fileName:s,lineNumber:a&&a[1],columnNumber:a&&a[3]}}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/picocolors/1.1.1/a2cca8821324d9b53ce284317d33c07b8ca7ab5b808164538a24d91cf6e92abb/node_modules/picocolors/picocolors.js"(e){let t=process||{},n=t.argv||[],o=t.env||{},i=!(o.NO_COLOR||n.includes("--no-color"))&&(!!o.FORCE_COLOR||n.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==o.TERM||!!o.CI),s=(e,t,n=e)=>o=>{let i=""+o,s=i.indexOf(t,e.length);return~s?e+a(i,t,n,s)+t:e+i+t},a=(e,t,n,o)=>{let i="",s=0;do i+=e.substring(s,o)+n,s=o+t.length,o=e.indexOf(t,s);while(~o);return i+e.substring(s)},r=(e=i)=>{let t=e?s:()=>String;return{isColorSupported:e,reset:t("\x1b[0m","\x1b[0m"),bold:t("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),dim:t("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),italic:t("\x1b[3m","\x1b[23m"),underline:t("\x1b[4m","\x1b[24m"),inverse:t("\x1b[7m","\x1b[27m"),hidden:t("\x1b[8m","\x1b[28m"),strikethrough:t("\x1b[9m","\x1b[29m"),black:t("\x1b[30m","\x1b[39m"),red:t("\x1b[31m","\x1b[39m"),green:t("\x1b[32m","\x1b[39m"),yellow:t("\x1b[33m","\x1b[39m"),blue:t("\x1b[34m","\x1b[39m"),magenta:t("\x1b[35m","\x1b[39m"),cyan:t("\x1b[36m","\x1b[39m"),white:t("\x1b[37m","\x1b[39m"),gray:t("\x1b[90m","\x1b[39m"),bgBlack:t("\x1b[40m","\x1b[49m"),bgRed:t("\x1b[41m","\x1b[49m"),bgGreen:t("\x1b[42m","\x1b[49m"),bgYellow:t("\x1b[43m","\x1b[49m"),bgBlue:t("\x1b[44m","\x1b[49m"),bgMagenta:t("\x1b[45m","\x1b[49m"),bgCyan:t("\x1b[46m","\x1b[49m"),bgWhite:t("\x1b[47m","\x1b[49m"),blackBright:t("\x1b[90m","\x1b[39m"),redBright:t("\x1b[91m","\x1b[39m"),greenBright:t("\x1b[92m","\x1b[39m"),yellowBright:t("\x1b[93m","\x1b[39m"),blueBright:t("\x1b[94m","\x1b[39m"),magentaBright:t("\x1b[95m","\x1b[39m"),cyanBright:t("\x1b[96m","\x1b[39m"),whiteBright:t("\x1b[97m","\x1b[39m"),bgBlackBright:t("\x1b[100m","\x1b[49m"),bgRedBright:t("\x1b[101m","\x1b[49m"),bgGreenBright:t("\x1b[102m","\x1b[49m"),bgYellowBright:t("\x1b[103m","\x1b[49m"),bgBlueBright:t("\x1b[104m","\x1b[49m"),bgMagentaBright:t("\x1b[105m","\x1b[49m"),bgCyanBright:t("\x1b[106m","\x1b[49m"),bgWhiteBright:t("\x1b[107m","\x1b[49m")}};e.exports=r(),e.exports.createColors=r},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/index.js"(t,n){e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/quote.js"),n.parse=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/parse.js")},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/parse.js"(e){for(var t="(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])",n=RegExp("^"+t+"$"),o="|&;()<> \\t",i=/^#$/,s="",a=0;a<4;a++)s+=(0x100000000*Math.random()).toString(16);var r=RegExp("^"+s);e.exports=function(e,a,c){var l=function(e,a,r){r||(r={});var c=r.escape||"\\",l=!0===r.splitUnquoted?" \n":"string"==typeof r.splitUnquoted?r.splitUnquoted:"",p=function(e,t){for(var n,o=t.lastIndex,i=[];n=t.exec(e);)i[i.length]=n,t.lastIndex===n.index&&(t.lastIndex+=1);return t.lastIndex=o,i}(e,RegExp(["("+t+")","("+("(\\"+c+"['\""+o+"]|[^\\s'\""+o)+'])+|"((\\\\"|[^"])*?)"|\'([^\']*?)\')+'].join("|"),"g"));if(0===p.length)return[];a||(a={});var d=!1;return p.map(function(t){var o,r=t[0];if(r&&!d){if(n.test(r))return{op:r};var p=!1,u=!1,m="",b=[],f=!1,h=null,x=!1;for(o=0;o<r.length;o++){var g=r.charAt(o);if(l&&"$"!==g&&O(),x=x||!p&&("*"===g||"?"===g),u)m+=g,u=!1;else if(p)g===p?p=!1:"'"==p?m+=g:g===c?(o+=1,'"'===(g=r.charAt(o))||g===c||"$"===g?m+=g:m+=c+g):"$"===g?m+=_():m+=g;else if('"'===g||"'"===g)p=g,f=!0;else if(n.test(g))return{op:r};else if(i.test(g)){d=!0;var v={comment:e.slice(t.index+o+1)};if(m.length)return[m,v];return[v]}else if(g===c)u=!0;else if("$"===g){var C=_();if(l)for(var S=0;S<C.length;S+=1){var A=C.charAt(S);0>l.indexOf(A)?(O(),m+=A):null===h?h=+(" "!==A&&" "!==A&&"\n"!==A):" "!==A&&" "!==A&&"\n"!==A&&(h+=1)}else m+=C}else m+=g}if(x)return{op:"glob",pattern:m};if(l){if(null!==h&&h>0){b[b.length]=m,m="";for(var y=1;y<h;y+=1)b[b.length]=""}return(""!==m||f&&0===b.length)&&(b[b.length]=m),b}return m}function _(){o+=1;var e,t,n,i,c,l=r.charAt(o);if("{"===l){if(o+=1,"}"===r.charAt(o))throw Error("Bad substitution: "+r.slice(o-2,o+1));var p=1;for(i=o;p>0&&i<r.length;)"{"===r.charAt(i)&&"$"===r.charAt(i-1)?p+=1:"}"===r.charAt(i)&&(p-=1),i+=1;if(0!==p)throw Error("Bad substitution: "+r.slice(o));i-=1,c=r.slice(o,i),o=i}else if(/[*@#?$!_-]/.test(l))c=l,o+=1;else{var d=r.slice(o);(i=d.match(/[^\w\d_]/))?(c=d.slice(0,i.index),o+=i.index-1):(c=d,o=r.length)}return e=a,t=c,(void 0===(n="function"==typeof e?e(t):e[t])&&""!=t?n="":void 0===n&&(n="$"),"object"==typeof n)?""+s+JSON.stringify(n)+s:""+n}function O(){if(null!==h){if(0===h)""!==m&&(b[b.length]=m,m="");else{b[b.length]=m,m="";for(var e=1;e<h;e+=1)b[b.length]=""}h=null}}}).reduce(function(e,t){return void 0===t||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}(e,a,c);return"function"!=typeof a?l:l.reduce(function(e,t){if("object"==typeof t)return e[e.length]=t,e;var n=t.split(RegExp("("+s+".*?"+s+")","g"));return 1===n.length?e[e.length]=n[0]:n.filter(Boolean).forEach(function(t){e[e.length]=r.test(t)?JSON.parse(t.split(s)[1]):t}),e},[])}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/quote.js"(e){var t=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],n=/[\n\r\u2028\u2029]/,o=/[\s#!"$&'():;<=>@\\^`|]/g;e.exports=function(e){return e.map(function(e){if(""===e)return"''";if(e&&"object"==typeof e){if("op"in e&&"glob"===e.op){if("string"!=typeof e.pattern)throw TypeError("glob token requires a string `pattern`");if(n.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(o,"\\$&")}if("op"in e&&"string"==typeof e.op){if(0>t.indexOf(e.op))throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,"\\$&")}if("comment"in e&&"string"==typeof e.comment){if(n.test(e.comment))throw TypeError("`comment` must not contain line terminators");return"#"+e.comment}throw TypeError("unrecognized object token shape")}return/["\s\\]/.test(e)&&!/'/.test(e)?"'"+e.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(e)?'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"':String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}}}),e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor-middleware/2.14.2/46c81dbb0ad4cd8f776539a7cfaa5ea6144007363b919f05970ca6624282dcce/node_modules/launch-editor-middleware/index.js");
|
|
@@ -3,6 +3,7 @@ import type { CSSLoaderOptions } from '../types/index.js';
|
|
|
3
3
|
type CSSUrlLoaderOptions = {
|
|
4
4
|
filename: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
|
5
5
|
modules: CSSLoaderOptions['modules'];
|
|
6
|
+
minimized: boolean;
|
|
6
7
|
};
|
|
7
8
|
declare const cssUrlLoader: LoaderDefinitionFunction<CSSUrlLoaderOptions>;
|
|
8
9
|
export declare const pitch: PitchLoaderDefinitionFunction<CSSUrlLoaderOptions>;
|