@pawover/kit 0.0.0-alpha.31 → 0.0.0-alpha.32
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/dist/vite.d.ts +1 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +3 -2
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
package/dist/vite.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { ProxyOptions } from "vite";
|
|
|
7
7
|
*
|
|
8
8
|
* @param proxyList 代理配置项
|
|
9
9
|
*/
|
|
10
|
-
declare function resolveViteProxy<L extends [string, string][]>(proxyList: L): Record<string, ProxyOptions>;
|
|
10
|
+
declare function resolveViteProxy<L extends [string, string][]>(proxyList: L, options?: ProxyOptions | undefined): Record<string, ProxyOptions>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { resolveViteProxy };
|
|
13
13
|
//# sourceMappingURL=vite.d.ts.map
|
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","names":[],"sources":["../src/vite/proxy.ts"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"vite.d.ts","names":[],"sources":["../src/vite/proxy.ts"],"sourcesContent":[],"mappings":";;;;;;AAQA;;;AAAiI,iBAAjH,gBAAiH,CAAA,UAAA,CAAA,MAAA,EAAA,MAAA,CAAA,EAAA,CAAA,CAAA,SAAA,EAAvD,CAAuD,EAAA,OAAA,CAAA,EAA1C,YAA0C,GAAA,SAAA,CAAA,EAAf,MAAe,CAAA,MAAA,EAAA,YAAA,CAAA"}
|
package/dist/vite.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @param proxyList 代理配置项
|
|
6
6
|
*/
|
|
7
|
-
function resolveViteProxy(proxyList) {
|
|
7
|
+
function resolveViteProxy(proxyList, options) {
|
|
8
8
|
const httpsRE = /^https:\/\//;
|
|
9
9
|
const result = {};
|
|
10
10
|
if (typeof proxyList === "object") for (const [prefix, target] of proxyList) result[prefix] = {
|
|
@@ -12,7 +12,8 @@ function resolveViteProxy(proxyList) {
|
|
|
12
12
|
changeOrigin: true,
|
|
13
13
|
ws: true,
|
|
14
14
|
rewrite: (path) => path.replace(/* @__PURE__ */ new RegExp(`^${prefix}`), ""),
|
|
15
|
-
...httpsRE.test(target) ? { secure: false } : {}
|
|
15
|
+
...httpsRE.test(target) ? { secure: false } : {},
|
|
16
|
+
...options
|
|
16
17
|
};
|
|
17
18
|
return result;
|
|
18
19
|
}
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","names":["result: Record<string, ProxyOptions>"],"sources":["../src/vite/proxy.ts"],"sourcesContent":["import type { ProxyOptions } from \"vite\";\n\n/**\n * 开发服务器反向代理配置\n *\n * @param proxyList 代理配置项\n */\nexport function resolveViteProxy<L extends [string, string][]>(proxyList: L): Record<string, ProxyOptions> {\n const httpsRE = /^https:\\/\\//;\n const result: Record<string, ProxyOptions> = {};\n\n if (typeof proxyList === \"object\") {\n for (const [prefix, target] of proxyList) {\n const isHttps = httpsRE.test(target);\n\n // https://github.com/http-party/node-http-proxy#options\n result[prefix] = {\n target,\n changeOrigin: true,\n ws: true,\n rewrite: (path) => path.replace(new RegExp(`^${prefix}`), \"\"),\n // https 需要开启 secure = false\n ...isHttps ? { secure: false } : {},\n };\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"vite.js","names":["result: Record<string, ProxyOptions>"],"sources":["../src/vite/proxy.ts"],"sourcesContent":["import type { ProxyOptions } from \"vite\";\n\n\n/**\n * 开发服务器反向代理配置\n *\n * @param proxyList 代理配置项\n */\nexport function resolveViteProxy<L extends [string, string][]>(proxyList: L, options?: ProxyOptions | undefined): Record<string, ProxyOptions> {\n const httpsRE = /^https:\\/\\//;\n const result: Record<string, ProxyOptions> = {};\n\n if (typeof proxyList === \"object\") {\n for (const [prefix, target] of proxyList) {\n const isHttps = httpsRE.test(target);\n\n // https://github.com/http-party/node-http-proxy#options\n result[prefix] = {\n target,\n changeOrigin: true,\n ws: true,\n rewrite: (path) => path.replace(new RegExp(`^${prefix}`), \"\"),\n // https 需要开启 secure = false\n ...isHttps ? { secure: false } : {},\n ...options,\n };\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;AAQA,SAAgB,iBAA+C,WAAc,SAAkE;CAC7I,MAAM,UAAU;CAChB,MAAMA,SAAuC,EAAE;AAE/C,KAAI,OAAO,cAAc,SACvB,MAAK,MAAM,CAAC,QAAQ,WAAW,UAI7B,QAAO,UAAU;EACf;EACA,cAAc;EACd,IAAI;EACJ,UAAU,SAAS,KAAK,wBAAQ,IAAI,OAAO,IAAI,SAAS,EAAE,GAAG;EAE7D,GATc,QAAQ,KAAK,OAAO,GASrB,EAAE,QAAQ,OAAO,GAAG,EAAE;EACnC,GAAG;EACJ;AAIL,QAAO"}
|