unplugin-dingtalk 1007.0.1 → 1007.0.2
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 +1 -0
- package/dist/{__chrome_devtools-CJ3sXpVj.cjs → __chrome_devtools-DXNY3hbb.cjs} +2 -2
- package/dist/{__chrome_devtools-CIQ5zFZx.js → __chrome_devtools-DtQ6IXAu.js} +2 -2
- package/dist/__chrome_devtools.cjs +1 -1
- package/dist/__chrome_devtools.d.cts +1 -1
- package/dist/__chrome_devtools.d.ts +1 -1
- package/dist/__chrome_devtools.js +1 -1
- package/dist/astro.cjs +3 -3
- package/dist/astro.js +3 -3
- package/dist/esbuild.cjs +3 -3
- package/dist/esbuild.js +3 -3
- package/dist/index.cjs +5 -3
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -4
- package/dist/inject-script.cjs +2 -1
- package/dist/inject-script.js +2 -1
- package/dist/nuxt.cjs +21 -10
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +21 -10
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +6 -6
- package/dist/rspack.js +6 -6
- package/dist/{src-CXHMJspk.cjs → src-7U04DWRB.cjs} +51 -24
- package/dist/{src-DJcUe9oP.js → src-DD2TG884.js} +40 -25
- package/dist/{utils-CmfBxo4J.cjs → utils-3gBRwB2B.cjs} +10 -0
- package/dist/{utils-Chlbb6jf.js → utils-DORRNjr1.js} +5 -1
- package/dist/utils.cjs +2 -1
- package/dist/utils.d.cts +2 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +2 -2
- package/dist/{vite-qeAmx9J4.js → vite-BqXPfqlC.js} +2 -2
- package/dist/{vite-ytxVicjL.cjs → vite-Ds1Kt2Lk.cjs} +2 -2
- package/dist/vite.cjs +4 -4
- package/dist/vite.js +4 -4
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# unplugin-dingtalk
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/unplugin-dingtalk)
|
|
4
|
+
[](https://deepwiki.com/zcf0508/unplugin-dingtalk)
|
|
4
5
|
|
|
5
6
|
一键启动钉钉内调试。支持 `vite`、`vue-cli`、`rsbuild`。
|
|
6
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/__chrome_devtools.ts
|
|
3
|
-
function getChromeDevtoolsHtml(targetPort) {
|
|
3
|
+
function getChromeDevtoolsHtml(targetPort, proxyPath) {
|
|
4
4
|
return `<!DOCTYPE html>
|
|
5
5
|
<html>
|
|
6
6
|
|
|
@@ -54,7 +54,7 @@ function getChromeDevtoolsHtml(targetPort) {
|
|
|
54
54
|
const list = document.getElementById("target-list");
|
|
55
55
|
list.innerHTML = "<li>加载中...</li>";
|
|
56
56
|
try {
|
|
57
|
-
const resp = await fetch("/
|
|
57
|
+
const resp = await fetch("${proxyPath}/targets");
|
|
58
58
|
const data = await resp.json();
|
|
59
59
|
const targets = data.targets || [];
|
|
60
60
|
if (targets.length === 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/__chrome_devtools.ts
|
|
2
|
-
function getChromeDevtoolsHtml(targetPort) {
|
|
2
|
+
function getChromeDevtoolsHtml(targetPort, proxyPath) {
|
|
3
3
|
return `<!DOCTYPE html>
|
|
4
4
|
<html>
|
|
5
5
|
|
|
@@ -53,7 +53,7 @@ function getChromeDevtoolsHtml(targetPort) {
|
|
|
53
53
|
const list = document.getElementById("target-list");
|
|
54
54
|
list.innerHTML = "<li>加载中...</li>";
|
|
55
55
|
try {
|
|
56
|
-
const resp = await fetch("/
|
|
56
|
+
const resp = await fetch("${proxyPath}/targets");
|
|
57
57
|
const data = await resp.json();
|
|
58
58
|
const targets = data.targets || [];
|
|
59
59
|
if (targets.length === 0) {
|
package/dist/astro.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require('./__chrome_devtools-
|
|
2
|
-
const require_src = require('./src-
|
|
3
|
-
require('./utils-
|
|
1
|
+
require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
2
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
3
|
+
require('./utils-3gBRwB2B.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/astro.ts
|
|
6
6
|
var astro_default = (options) => ({
|
package/dist/astro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./__chrome_devtools-
|
|
2
|
-
import { src_default } from "./src-
|
|
3
|
-
import "./utils-
|
|
1
|
+
import "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { src_default } from "./src-DD2TG884.js";
|
|
3
|
+
import "./utils-DORRNjr1.js";
|
|
4
4
|
|
|
5
5
|
//#region src/astro.ts
|
|
6
6
|
var astro_default = (options) => ({
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
require('./__chrome_devtools-
|
|
3
|
-
const require_src = require('./src-
|
|
4
|
-
require('./utils-
|
|
2
|
+
require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
3
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
4
|
+
require('./utils-3gBRwB2B.cjs');
|
|
5
5
|
const unplugin = require_chunk.__toESM(require("unplugin"));
|
|
6
6
|
|
|
7
7
|
//#region src/esbuild.ts
|
package/dist/esbuild.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./__chrome_devtools-
|
|
2
|
-
import { unpluginFactory } from "./src-
|
|
3
|
-
import "./utils-
|
|
1
|
+
import "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { unpluginFactory } from "./src-DD2TG884.js";
|
|
3
|
+
import "./utils-DORRNjr1.js";
|
|
4
4
|
import { createEsbuildPlugin } from "unplugin";
|
|
5
5
|
|
|
6
6
|
//#region src/esbuild.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./__chrome_devtools-
|
|
3
|
-
const require_src = require('./src-
|
|
4
|
-
require('./utils-
|
|
2
|
+
require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
3
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
4
|
+
require('./utils-3gBRwB2B.cjs');
|
|
5
5
|
|
|
6
|
+
exports.CHII_DEVTOOLS_PATH = require_src.CHII_DEVTOOLS_PATH;
|
|
7
|
+
exports.CHII_PROXY_PATH = require_src.CHII_PROXY_PATH;
|
|
6
8
|
exports.createProxyMiddleware = require_src.createProxyMiddleware;
|
|
7
9
|
exports.default = require_src.src_default;
|
|
8
10
|
exports.resovedInfo = require_src.resovedInfo;
|
package/dist/index.d.cts
CHANGED
|
@@ -4,14 +4,16 @@ import { UnpluginFactory } from "unplugin";
|
|
|
4
4
|
import { Connect } from "vite";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
|
7
|
+
declare const CHII_PROXY_PATH: string;
|
|
8
|
+
declare const CHII_DEVTOOLS_PATH: string;
|
|
7
9
|
declare const resovedInfo: {
|
|
8
10
|
availablePort: number | undefined;
|
|
9
11
|
targetURL: undefined | URL;
|
|
10
12
|
};
|
|
11
|
-
declare function createProxyMiddleware(debug: typeof console.debug): (resolvedInfo: {
|
|
13
|
+
declare function createProxyMiddleware(debug: typeof console.debug, proxyPath: string): (resolvedInfo: {
|
|
12
14
|
availablePort?: number;
|
|
13
15
|
}) => Connect.NextHandleFunction;
|
|
14
16
|
declare const unpluginFactory: UnpluginFactory<Options | undefined, boolean>;
|
|
15
17
|
declare const unplugin: unplugin0.UnpluginInstance<Options | undefined, boolean>;
|
|
16
18
|
//#endregion
|
|
17
|
-
export { createProxyMiddleware, unplugin as default, unplugin, resovedInfo, unpluginFactory };
|
|
19
|
+
export { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, createProxyMiddleware, unplugin as default, unplugin, resovedInfo, unpluginFactory };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,14 +4,16 @@ import { UnpluginFactory } from "unplugin";
|
|
|
4
4
|
import { Connect } from "vite";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
|
7
|
+
declare const CHII_PROXY_PATH: string;
|
|
8
|
+
declare const CHII_DEVTOOLS_PATH: string;
|
|
7
9
|
declare const resovedInfo: {
|
|
8
10
|
availablePort: number | undefined;
|
|
9
11
|
targetURL: undefined | URL;
|
|
10
12
|
};
|
|
11
|
-
declare function createProxyMiddleware(debug: typeof console.debug): (resolvedInfo: {
|
|
13
|
+
declare function createProxyMiddleware(debug: typeof console.debug, proxyPath: string): (resolvedInfo: {
|
|
12
14
|
availablePort?: number;
|
|
13
15
|
}) => Connect.NextHandleFunction;
|
|
14
16
|
declare const unpluginFactory: UnpluginFactory<Options | undefined, boolean>;
|
|
15
17
|
declare const unplugin: unplugin0.UnpluginInstance<Options | undefined, boolean>;
|
|
16
18
|
//#endregion
|
|
17
|
-
export { createProxyMiddleware, unplugin as default, unplugin, resovedInfo, unpluginFactory };
|
|
19
|
+
export { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, createProxyMiddleware, unplugin as default, unplugin, resovedInfo, unpluginFactory };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./__chrome_devtools-
|
|
2
|
-
import { createProxyMiddleware, resovedInfo, src_default, unplugin, unpluginFactory } from "./src-
|
|
3
|
-
import "./utils-
|
|
1
|
+
import "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, createProxyMiddleware, resovedInfo, src_default, unplugin, unpluginFactory } from "./src-DD2TG884.js";
|
|
3
|
+
import "./utils-DORRNjr1.js";
|
|
4
4
|
|
|
5
|
-
export { createProxyMiddleware, src_default as default, resovedInfo, unplugin, unpluginFactory };
|
|
5
|
+
export { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, createProxyMiddleware, src_default as default, resovedInfo, unplugin, unpluginFactory };
|
package/dist/inject-script.cjs
CHANGED
|
@@ -6,7 +6,8 @@ var inject_script_default = (0, __imports.defineNitroPlugin)((nitroApp) => {
|
|
|
6
6
|
nitroApp.hooks.hook("render:html", (html) => {
|
|
7
7
|
const config = (0, __imports.useRuntimeConfig)();
|
|
8
8
|
const embedded = config.unpluginDingtalk?.chiiEmbedded ?? false;
|
|
9
|
-
const
|
|
9
|
+
const proxyPath = config.unpluginDingtalk?.chiiProxyPath || "/__chii_proxy";
|
|
10
|
+
const scriptTag = embedded ? `<script src="${proxyPath}/target.js" embedded="true"><\/script>` : `<script src="${proxyPath}/target.js"><\/script>`;
|
|
10
11
|
html.bodyAppend.push(scriptTag);
|
|
11
12
|
});
|
|
12
13
|
});
|
package/dist/inject-script.js
CHANGED
|
@@ -5,7 +5,8 @@ var inject_script_default = defineNitroPlugin((nitroApp) => {
|
|
|
5
5
|
nitroApp.hooks.hook("render:html", (html) => {
|
|
6
6
|
const config = useRuntimeConfig();
|
|
7
7
|
const embedded = config.unpluginDingtalk?.chiiEmbedded ?? false;
|
|
8
|
-
const
|
|
8
|
+
const proxyPath = config.unpluginDingtalk?.chiiProxyPath || "/__chii_proxy";
|
|
9
|
+
const scriptTag = embedded ? `<script src="${proxyPath}/target.js" embedded="true"><\/script>` : `<script src="${proxyPath}/target.js"><\/script>`;
|
|
9
10
|
html.bodyAppend.push(scriptTag);
|
|
10
11
|
});
|
|
11
12
|
});
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
require('./__chrome_devtools-
|
|
3
|
-
const require_src = require('./src-
|
|
4
|
-
const require_utils = require('./utils-
|
|
5
|
-
const require_vite = require('./vite-
|
|
2
|
+
require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
3
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
4
|
+
const require_utils = require('./utils-3gBRwB2B.cjs');
|
|
5
|
+
const require_vite = require('./vite-Ds1Kt2Lk.cjs');
|
|
6
6
|
const http_proxy = require_chunk.__toESM(require("http-proxy"));
|
|
7
7
|
const picocolors = require_chunk.__toESM(require("picocolors"));
|
|
8
8
|
const __nuxt_kit = require_chunk.__toESM(require("@nuxt/kit"));
|
|
@@ -24,22 +24,25 @@ var nuxt_default = (0, __nuxt_kit.defineNuxtModule)({
|
|
|
24
24
|
}
|
|
25
25
|
const { chii } = options || {};
|
|
26
26
|
const enableChii = chii?.enable !== false;
|
|
27
|
-
_nuxt.options.runtimeConfig.unpluginDingtalk = {
|
|
27
|
+
_nuxt.options.runtimeConfig.unpluginDingtalk = {
|
|
28
|
+
chiiEmbedded: chii?.embedded ?? false,
|
|
29
|
+
chiiProxyPath: require_src.CHII_PROXY_PATH
|
|
30
|
+
};
|
|
28
31
|
if (enableChii) {
|
|
29
32
|
const resolver = (0, __nuxt_kit.createResolver)(require("url").pathToFileURL(__filename).href);
|
|
30
33
|
(0, __nuxt_kit.addServerPlugin)(resolver.resolve("./inject-script"));
|
|
31
34
|
let proxy = null;
|
|
32
35
|
(0, __nuxt_kit.addDevServerHandler)({
|
|
33
|
-
route:
|
|
36
|
+
route: require_src.CHII_PROXY_PATH,
|
|
34
37
|
handler: defineEventHandler(async (event) => {
|
|
35
|
-
if (require_src.resovedInfo.availablePort) return proxyRequest(event, `http://localhost:${require_src.resovedInfo.availablePort}${event.path}`);
|
|
38
|
+
if (require_src.resovedInfo.availablePort) return proxyRequest(event, `http://localhost:${require_src.resovedInfo.availablePort}${event.path.replace(require_src.CHII_PROXY_PATH, "")}`);
|
|
36
39
|
})
|
|
37
40
|
});
|
|
38
41
|
_nuxt.hook("listen", (server) => {
|
|
39
42
|
const originalUpgradeListeners = server.listeners("upgrade").slice();
|
|
40
43
|
server.removeAllListeners("upgrade");
|
|
41
44
|
server.on("upgrade", (req, socket, head) => {
|
|
42
|
-
if (req.url?.startsWith(
|
|
45
|
+
if (req.url?.startsWith(require_src.CHII_PROXY_PATH)) {
|
|
43
46
|
debug("WS upgrade:", req.url);
|
|
44
47
|
if (!proxy && require_src.resovedInfo.availablePort) {
|
|
45
48
|
proxy = http_proxy.default.createProxyServer({
|
|
@@ -51,7 +54,7 @@ var nuxt_default = (0, __nuxt_kit.defineNuxtModule)({
|
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
if (proxy) {
|
|
54
|
-
req.url = req.url.replace(
|
|
57
|
+
req.url = req.url.replace(require_src.CHII_PROXY_PATH, "");
|
|
55
58
|
socket.on("error", (err) => {
|
|
56
59
|
debug("Socket error:", err.message);
|
|
57
60
|
});
|
|
@@ -67,13 +70,21 @@ var nuxt_default = (0, __nuxt_kit.defineNuxtModule)({
|
|
|
67
70
|
for (const listener of originalUpgradeListeners) listener.call(server, req, socket, head);
|
|
68
71
|
});
|
|
69
72
|
});
|
|
73
|
+
(0, __nuxt_kit.addDevServerHandler)({
|
|
74
|
+
route: require_src.CHII_DEVTOOLS_PATH,
|
|
75
|
+
handler: defineEventHandler(async (event) => {
|
|
76
|
+
if (!require_src.resovedInfo.availablePort) return "Server not started";
|
|
77
|
+
const { getChromeDevtoolsHtml } = await Promise.resolve().then(() => require("./__chrome_devtools.cjs"));
|
|
78
|
+
return getChromeDevtoolsHtml(require_src.resovedInfo.availablePort, require_src.CHII_PROXY_PATH);
|
|
79
|
+
})
|
|
80
|
+
});
|
|
70
81
|
}
|
|
71
82
|
const vitePlugins = await require_vite.vite_default(options);
|
|
72
83
|
(0, __nuxt_kit.addVitePlugin)(vitePlugins);
|
|
73
84
|
_nuxt.hook("listen", (_, listener) => {
|
|
74
85
|
const url = listener.url;
|
|
75
86
|
const source = new URL(url).host;
|
|
76
|
-
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source.replace("0.0.0.0", "localhost")}
|
|
87
|
+
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source.replace("0.0.0.0", "localhost")}${require_src.CHII_DEVTOOLS_PATH}`)}`);
|
|
77
88
|
});
|
|
78
89
|
}
|
|
79
90
|
});
|
package/dist/nuxt.d.cts
CHANGED
|
@@ -3,6 +3,6 @@ import * as _nuxt_schema0 from "@nuxt/schema";
|
|
|
3
3
|
|
|
4
4
|
//#region src/nuxt.d.ts
|
|
5
5
|
interface ModuleOptions extends Options {}
|
|
6
|
-
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions
|
|
6
|
+
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ModuleOptions, _default as default };
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import * as _nuxt_schema0 from "@nuxt/schema";
|
|
|
3
3
|
|
|
4
4
|
//#region src/nuxt.d.ts
|
|
5
5
|
interface ModuleOptions extends Options {}
|
|
6
|
-
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions
|
|
6
|
+
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ModuleOptions, _default as default };
|
package/dist/nuxt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./__chrome_devtools-
|
|
2
|
-
import { resovedInfo } from "./src-
|
|
3
|
-
import { colorUrl, interopDefault } from "./utils-
|
|
4
|
-
import { vite_default } from "./vite-
|
|
1
|
+
import "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, resovedInfo } from "./src-DD2TG884.js";
|
|
3
|
+
import { colorUrl, interopDefault } from "./utils-DORRNjr1.js";
|
|
4
|
+
import { vite_default } from "./vite-BqXPfqlC.js";
|
|
5
5
|
import httpProxy from "http-proxy";
|
|
6
6
|
import c from "picocolors";
|
|
7
7
|
import { addDevServerHandler, addServerPlugin, addVitePlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
|
|
@@ -23,22 +23,25 @@ var nuxt_default = defineNuxtModule({
|
|
|
23
23
|
}
|
|
24
24
|
const { chii } = options || {};
|
|
25
25
|
const enableChii = chii?.enable !== false;
|
|
26
|
-
_nuxt.options.runtimeConfig.unpluginDingtalk = {
|
|
26
|
+
_nuxt.options.runtimeConfig.unpluginDingtalk = {
|
|
27
|
+
chiiEmbedded: chii?.embedded ?? false,
|
|
28
|
+
chiiProxyPath: CHII_PROXY_PATH
|
|
29
|
+
};
|
|
27
30
|
if (enableChii) {
|
|
28
31
|
const resolver = createResolver(import.meta.url);
|
|
29
32
|
addServerPlugin(resolver.resolve("./inject-script"));
|
|
30
33
|
let proxy = null;
|
|
31
34
|
addDevServerHandler({
|
|
32
|
-
route:
|
|
35
|
+
route: CHII_PROXY_PATH,
|
|
33
36
|
handler: defineEventHandler(async (event) => {
|
|
34
|
-
if (resovedInfo.availablePort) return proxyRequest(event, `http://localhost:${resovedInfo.availablePort}${event.path}`);
|
|
37
|
+
if (resovedInfo.availablePort) return proxyRequest(event, `http://localhost:${resovedInfo.availablePort}${event.path.replace(CHII_PROXY_PATH, "")}`);
|
|
35
38
|
})
|
|
36
39
|
});
|
|
37
40
|
_nuxt.hook("listen", (server) => {
|
|
38
41
|
const originalUpgradeListeners = server.listeners("upgrade").slice();
|
|
39
42
|
server.removeAllListeners("upgrade");
|
|
40
43
|
server.on("upgrade", (req, socket, head) => {
|
|
41
|
-
if (req.url?.startsWith(
|
|
44
|
+
if (req.url?.startsWith(CHII_PROXY_PATH)) {
|
|
42
45
|
debug("WS upgrade:", req.url);
|
|
43
46
|
if (!proxy && resovedInfo.availablePort) {
|
|
44
47
|
proxy = httpProxy.createProxyServer({
|
|
@@ -50,7 +53,7 @@ var nuxt_default = defineNuxtModule({
|
|
|
50
53
|
});
|
|
51
54
|
}
|
|
52
55
|
if (proxy) {
|
|
53
|
-
req.url = req.url.replace(
|
|
56
|
+
req.url = req.url.replace(CHII_PROXY_PATH, "");
|
|
54
57
|
socket.on("error", (err) => {
|
|
55
58
|
debug("Socket error:", err.message);
|
|
56
59
|
});
|
|
@@ -66,13 +69,21 @@ var nuxt_default = defineNuxtModule({
|
|
|
66
69
|
for (const listener of originalUpgradeListeners) listener.call(server, req, socket, head);
|
|
67
70
|
});
|
|
68
71
|
});
|
|
72
|
+
addDevServerHandler({
|
|
73
|
+
route: CHII_DEVTOOLS_PATH,
|
|
74
|
+
handler: defineEventHandler(async (event) => {
|
|
75
|
+
if (!resovedInfo.availablePort) return "Server not started";
|
|
76
|
+
const { getChromeDevtoolsHtml } = await import("./__chrome_devtools.js");
|
|
77
|
+
return getChromeDevtoolsHtml(resovedInfo.availablePort, CHII_PROXY_PATH);
|
|
78
|
+
})
|
|
79
|
+
});
|
|
69
80
|
}
|
|
70
81
|
const vitePlugins = await vite_default(options);
|
|
71
82
|
addVitePlugin(vitePlugins);
|
|
72
83
|
_nuxt.hook("listen", (_, listener) => {
|
|
73
84
|
const url = listener.url;
|
|
74
85
|
const source = new URL(url).host;
|
|
75
|
-
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source.replace("0.0.0.0", "localhost")}
|
|
86
|
+
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source.replace("0.0.0.0", "localhost")}${CHII_DEVTOOLS_PATH}`)}`);
|
|
76
87
|
});
|
|
77
88
|
}
|
|
78
89
|
});
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
require('./__chrome_devtools-
|
|
3
|
-
const require_src = require('./src-
|
|
4
|
-
require('./utils-
|
|
2
|
+
require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
3
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
4
|
+
require('./utils-3gBRwB2B.cjs');
|
|
5
5
|
const unplugin = require_chunk.__toESM(require("unplugin"));
|
|
6
6
|
|
|
7
7
|
//#region src/rollup.ts
|
package/dist/rollup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./__chrome_devtools-
|
|
2
|
-
import { unpluginFactory } from "./src-
|
|
3
|
-
import "./utils-
|
|
1
|
+
import "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { unpluginFactory } from "./src-DD2TG884.js";
|
|
3
|
+
import "./utils-DORRNjr1.js";
|
|
4
4
|
import { createRollupPlugin } from "unplugin";
|
|
5
5
|
|
|
6
6
|
//#region src/rollup.ts
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require___chrome_devtools = require('./__chrome_devtools-
|
|
3
|
-
const require_src = require('./src-
|
|
4
|
-
require('./utils-
|
|
2
|
+
const require___chrome_devtools = require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
3
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
4
|
+
require('./utils-3gBRwB2B.cjs');
|
|
5
5
|
const cookie = require_chunk.__toESM(require("cookie"));
|
|
6
6
|
const picocolors = require_chunk.__toESM(require("picocolors"));
|
|
7
7
|
const unplugin = require_chunk.__toESM(require("unplugin"));
|
|
@@ -25,10 +25,10 @@ var rspack_default = (options) => {
|
|
|
25
25
|
});
|
|
26
26
|
if (enableChii) {
|
|
27
27
|
middlewares.unshift(async (req, res, next) => {
|
|
28
|
-
if (req.url !==
|
|
28
|
+
if (req.url !== require_src.CHII_DEVTOOLS_PATH) return next();
|
|
29
29
|
try {
|
|
30
30
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
31
|
-
res.write(require___chrome_devtools.getChromeDevtoolsHtml(require_src.resovedInfo.availablePort));
|
|
31
|
+
res.write(require___chrome_devtools.getChromeDevtoolsHtml(require_src.resovedInfo.availablePort, require_src.CHII_PROXY_PATH));
|
|
32
32
|
res.end();
|
|
33
33
|
} catch (error) {
|
|
34
34
|
debug(`${error}`);
|
|
@@ -36,7 +36,7 @@ var rspack_default = (options) => {
|
|
|
36
36
|
res.end();
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
const proxyMiddleware = require_src.createProxyMiddleware(debug);
|
|
39
|
+
const proxyMiddleware = require_src.createProxyMiddleware(debug, require_src.CHII_PROXY_PATH);
|
|
40
40
|
middlewares.unshift(proxyMiddleware(require_src.resovedInfo));
|
|
41
41
|
}
|
|
42
42
|
middlewares.unshift((req, res, next) => {
|
package/dist/rspack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getChromeDevtoolsHtml } from "./__chrome_devtools-
|
|
2
|
-
import { createProxyMiddleware, resovedInfo, unpluginFactory } from "./src-
|
|
3
|
-
import "./utils-
|
|
1
|
+
import { getChromeDevtoolsHtml } from "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, createProxyMiddleware, resovedInfo, unpluginFactory } from "./src-DD2TG884.js";
|
|
3
|
+
import "./utils-DORRNjr1.js";
|
|
4
4
|
import cookie from "cookie";
|
|
5
5
|
import c from "picocolors";
|
|
6
6
|
import { createRspackPlugin } from "unplugin";
|
|
@@ -24,10 +24,10 @@ var rspack_default = (options) => {
|
|
|
24
24
|
});
|
|
25
25
|
if (enableChii) {
|
|
26
26
|
middlewares.unshift(async (req, res, next) => {
|
|
27
|
-
if (req.url !==
|
|
27
|
+
if (req.url !== CHII_DEVTOOLS_PATH) return next();
|
|
28
28
|
try {
|
|
29
29
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
30
|
-
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort));
|
|
30
|
+
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort, CHII_PROXY_PATH));
|
|
31
31
|
res.end();
|
|
32
32
|
} catch (error) {
|
|
33
33
|
debug(`${error}`);
|
|
@@ -35,7 +35,7 @@ var rspack_default = (options) => {
|
|
|
35
35
|
res.end();
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
const proxyMiddleware = createProxyMiddleware(debug);
|
|
38
|
+
const proxyMiddleware = createProxyMiddleware(debug, CHII_PROXY_PATH);
|
|
39
39
|
middlewares.unshift(proxyMiddleware(resovedInfo));
|
|
40
40
|
}
|
|
41
41
|
middlewares.unshift((req, res, next) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require___chrome_devtools = require('./__chrome_devtools-
|
|
3
|
-
const require_utils = require('./utils-
|
|
2
|
+
const require___chrome_devtools = require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
3
|
+
const require_utils = require('./utils-3gBRwB2B.cjs');
|
|
4
4
|
const node_http = require_chunk.__toESM(require("node:http"));
|
|
5
5
|
const node_net = require_chunk.__toESM(require("node:net"));
|
|
6
6
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
@@ -11,7 +11,7 @@ const picocolors = require_chunk.__toESM(require("picocolors"));
|
|
|
11
11
|
const unplugin = require_chunk.__toESM(require("unplugin"));
|
|
12
12
|
const z_chii = require_chunk.__toESM(require("z-chii"));
|
|
13
13
|
|
|
14
|
-
//#region node_modules/.pnpm/get-port-please@3.2
|
|
14
|
+
//#region node_modules/.pnpm/get-port-please@3.1.2/node_modules/get-port-please/dist/index.mjs
|
|
15
15
|
const unsafePorts = /* @__PURE__ */ new Set([
|
|
16
16
|
1,
|
|
17
17
|
7,
|
|
@@ -100,12 +100,23 @@ function isUnsafePort(port) {
|
|
|
100
100
|
function isSafePort(port) {
|
|
101
101
|
return !isUnsafePort(port);
|
|
102
102
|
}
|
|
103
|
+
var __defProp = Object.defineProperty;
|
|
104
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
configurable: true,
|
|
107
|
+
writable: true,
|
|
108
|
+
value
|
|
109
|
+
}) : obj[key] = value;
|
|
110
|
+
var __publicField = (obj, key, value) => {
|
|
111
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
112
|
+
return value;
|
|
113
|
+
};
|
|
103
114
|
var GetPortError = class extends Error {
|
|
104
115
|
constructor(message, opts) {
|
|
105
116
|
super(message, opts);
|
|
106
117
|
this.message = message;
|
|
118
|
+
__publicField(this, "name", "GetPortError");
|
|
107
119
|
}
|
|
108
|
-
name = "GetPortError";
|
|
109
120
|
};
|
|
110
121
|
function _log(verbose, message) {
|
|
111
122
|
if (verbose) console.log(`[get-port] ${message}`);
|
|
@@ -130,7 +141,7 @@ function _tryPort(port, host) {
|
|
|
130
141
|
}
|
|
131
142
|
function _getLocalHosts(additional) {
|
|
132
143
|
const hosts = new Set(additional);
|
|
133
|
-
for (const _interface of Object.values((0, node_os.networkInterfaces)())) for (const config$1 of _interface || []) if (config$1.address && !config$1.internal && !config$1.address.startsWith("fe80::")
|
|
144
|
+
for (const _interface of Object.values((0, node_os.networkInterfaces)())) for (const config$1 of _interface || []) if (config$1.address && !config$1.internal && !config$1.address.startsWith("fe80::")) hosts.add(config$1.address);
|
|
134
145
|
return [...hosts];
|
|
135
146
|
}
|
|
136
147
|
function _fmtOnHost(hostname) {
|
|
@@ -158,23 +169,27 @@ async function checkPort(port, host = process.env.HOST, verbose) {
|
|
|
158
169
|
//#endregion
|
|
159
170
|
//#region src/index.ts
|
|
160
171
|
const cwd = node_process.default.cwd();
|
|
172
|
+
const projectHash = require_utils.getProjectHash();
|
|
173
|
+
const CHII_PROXY_PATH = `/__chii_proxy_${projectHash}`;
|
|
174
|
+
const CHII_DEVTOOLS_PATH = `/__chrome_devtools_${projectHash}`;
|
|
175
|
+
const VIRTUAL_CHII_CLIENT = `/__chii_client_${projectHash}.js`;
|
|
161
176
|
let config;
|
|
162
177
|
const resovedInfo = {
|
|
163
178
|
availablePort: void 0,
|
|
164
179
|
targetURL: void 0
|
|
165
180
|
};
|
|
166
|
-
function createProxyMiddleware(debug) {
|
|
181
|
+
function createProxyMiddleware(debug, proxyPath) {
|
|
167
182
|
let proxy = null;
|
|
168
183
|
const handleUpgrade = (req, socket, head) => {
|
|
169
|
-
if (proxy && req.url?.startsWith(
|
|
184
|
+
if (proxy && req.url?.startsWith(proxyPath)) {
|
|
170
185
|
debug("WS upgrade:", req.url);
|
|
171
|
-
req.url = req.url.replace(
|
|
186
|
+
req.url = req.url.replace(proxyPath, "");
|
|
172
187
|
proxy.ws(req, socket, head);
|
|
173
188
|
}
|
|
174
189
|
};
|
|
175
190
|
return (resolvedInfo) => {
|
|
176
191
|
return (req, res, next) => {
|
|
177
|
-
if (req.url?.startsWith(
|
|
192
|
+
if (req.url?.startsWith(proxyPath)) req._skip_transform = true;
|
|
178
193
|
if (!proxy && resolvedInfo.availablePort) {
|
|
179
194
|
proxy = http_proxy.default.createProxyServer({
|
|
180
195
|
target: `http://localhost:${resolvedInfo.availablePort}`,
|
|
@@ -189,9 +204,9 @@ function createProxyMiddleware(debug) {
|
|
|
189
204
|
});
|
|
190
205
|
if (req.socket.server) req.socket.server.on("upgrade", handleUpgrade);
|
|
191
206
|
}
|
|
192
|
-
if (proxy && req.url?.startsWith(
|
|
207
|
+
if (proxy && req.url?.startsWith(proxyPath)) {
|
|
193
208
|
debug(req.url);
|
|
194
|
-
req.url = req.url.replace(
|
|
209
|
+
req.url = req.url.replace(proxyPath, "");
|
|
195
210
|
proxy.web(req, res);
|
|
196
211
|
} else next();
|
|
197
212
|
};
|
|
@@ -208,18 +223,18 @@ const unpluginFactory = (options) => {
|
|
|
208
223
|
name: "unplugin-dingtalk",
|
|
209
224
|
enforce: "pre",
|
|
210
225
|
resolveId(source) {
|
|
211
|
-
if (source === "chii-client") return
|
|
226
|
+
if (source === "chii-client" || source === VIRTUAL_CHII_CLIENT) return VIRTUAL_CHII_CLIENT;
|
|
212
227
|
},
|
|
213
228
|
loadInclude(id) {
|
|
214
|
-
return id ===
|
|
229
|
+
return id === VIRTUAL_CHII_CLIENT;
|
|
215
230
|
},
|
|
216
231
|
load(id) {
|
|
217
|
-
if (id ===
|
|
232
|
+
if (id === VIRTUAL_CHII_CLIENT) return `
|
|
218
233
|
;(function(){
|
|
219
234
|
if (document.getElementById('__chii_client')) return;
|
|
220
235
|
const script = document.createElement('script');
|
|
221
236
|
script.id = '__chii_client';
|
|
222
|
-
script.src="/
|
|
237
|
+
script.src="${CHII_PROXY_PATH}/target.js";
|
|
223
238
|
${options?.chii?.embedded ? "script.setAttribute('embedded','true');" : ""}
|
|
224
239
|
document.body.appendChild(script);
|
|
225
240
|
})();
|
|
@@ -229,7 +244,7 @@ if (import.meta.hot) {
|
|
|
229
244
|
if (old) old.remove();
|
|
230
245
|
const script = document.createElement('script');
|
|
231
246
|
script.id = '__chii_client';
|
|
232
|
-
script.src="/
|
|
247
|
+
script.src="${CHII_PROXY_PATH}/target.js";
|
|
233
248
|
${options?.chii?.embedded ? "script.setAttribute('embedded','true');" : ""}
|
|
234
249
|
document.body.appendChild(script);
|
|
235
250
|
});
|
|
@@ -248,7 +263,7 @@ if (import.meta.hot) {
|
|
|
248
263
|
if (options?.enable && enableChii) {
|
|
249
264
|
const file = id.split("?")[0];
|
|
250
265
|
if (file.startsWith(config?.root || cwd) && !file.includes("node_modules") && file.match(/\.[t|j]s$/) && !isNuxt) return {
|
|
251
|
-
code: `import '
|
|
266
|
+
code: `import '${VIRTUAL_CHII_CLIENT}';\n${source}`,
|
|
252
267
|
map: null
|
|
253
268
|
};
|
|
254
269
|
}
|
|
@@ -263,7 +278,7 @@ if (import.meta.hot) {
|
|
|
263
278
|
},
|
|
264
279
|
transformIndexHtml(html) {
|
|
265
280
|
if (options?.enable && enableChii && !isNuxt) {
|
|
266
|
-
const tag =
|
|
281
|
+
const tag = `<script type="module">import '${VIRTUAL_CHII_CLIENT}';<\/script>`;
|
|
267
282
|
if (!html.includes(tag)) return html.replace("</body>", `</body>${tag}\n`);
|
|
268
283
|
}
|
|
269
284
|
return html;
|
|
@@ -282,7 +297,7 @@ if (import.meta.hot) {
|
|
|
282
297
|
server.printUrls = () => {
|
|
283
298
|
_printUrls();
|
|
284
299
|
console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Open in dingtalk")}: ${require_utils.colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
285
|
-
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source}${base}
|
|
300
|
+
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source}${base}${CHII_DEVTOOLS_PATH.replace(/^\//, "")}`)}`);
|
|
286
301
|
};
|
|
287
302
|
const targetURL = new URL(_targetUrl);
|
|
288
303
|
targetURL.searchParams.append("ddtab", "true");
|
|
@@ -296,18 +311,18 @@ if (import.meta.hot) {
|
|
|
296
311
|
next();
|
|
297
312
|
});
|
|
298
313
|
if (enableChii) {
|
|
299
|
-
server.middlewares.use(
|
|
314
|
+
server.middlewares.use(CHII_DEVTOOLS_PATH, async (_req, res) => {
|
|
300
315
|
if (!resovedInfo.availablePort) {
|
|
301
316
|
res.writeHead(500, { "Content-Type": "text/plain" });
|
|
302
317
|
res.end("Server not started");
|
|
303
318
|
return;
|
|
304
319
|
}
|
|
305
320
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
306
|
-
res.write(require___chrome_devtools.getChromeDevtoolsHtml(resovedInfo.availablePort));
|
|
321
|
+
res.write(require___chrome_devtools.getChromeDevtoolsHtml(resovedInfo.availablePort, CHII_PROXY_PATH));
|
|
307
322
|
res.end();
|
|
308
323
|
});
|
|
309
324
|
if (!isNuxt) {
|
|
310
|
-
const proxyMiddleware = createProxyMiddleware(debug);
|
|
325
|
+
const proxyMiddleware = createProxyMiddleware(debug, CHII_PROXY_PATH);
|
|
311
326
|
server.middlewares.use(proxyMiddleware(resovedInfo));
|
|
312
327
|
}
|
|
313
328
|
}
|
|
@@ -331,7 +346,7 @@ if (import.meta.hot) {
|
|
|
331
346
|
const _targetUrl = options?.targetUrl ?? `http://${source}${base}`;
|
|
332
347
|
compiler.hooks.done.tap("unplugin-dingtalk", () => {
|
|
333
348
|
console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Open in dingtalk")}: ${require_utils.colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
334
|
-
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source}${base}
|
|
349
|
+
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source}${base}${CHII_DEVTOOLS_PATH.replace(/^\//, "")}`)}`);
|
|
335
350
|
});
|
|
336
351
|
resovedInfo.targetURL = new URL(_targetUrl);
|
|
337
352
|
resovedInfo.targetURL.searchParams.append("ddtab", "true");
|
|
@@ -352,7 +367,7 @@ if (import.meta.hot) {
|
|
|
352
367
|
resovedInfo.targetURL.searchParams.append("ddtab", "true");
|
|
353
368
|
if (options?.corpId) resovedInfo.targetURL.searchParams.append("corpId", options.corpId);
|
|
354
369
|
console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Open in dingtalk")}: ${require_utils.colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
355
|
-
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source}${base}
|
|
370
|
+
if (enableChii) console.log(` ${picocolors.default.green("➜")} ${picocolors.default.bold("Click to open chrome devtools")}: ${require_utils.colorUrl(`http://${source}${base}${CHII_DEVTOOLS_PATH.replace(/^\//, "")}`)}`);
|
|
356
371
|
}
|
|
357
372
|
};
|
|
358
373
|
return unpluginDing;
|
|
@@ -361,6 +376,18 @@ const unplugin$1 = /* @__PURE__ */ (0, unplugin.createUnplugin)(unpluginFactory)
|
|
|
361
376
|
var src_default = unplugin$1;
|
|
362
377
|
|
|
363
378
|
//#endregion
|
|
379
|
+
Object.defineProperty(exports, 'CHII_DEVTOOLS_PATH', {
|
|
380
|
+
enumerable: true,
|
|
381
|
+
get: function () {
|
|
382
|
+
return CHII_DEVTOOLS_PATH;
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
Object.defineProperty(exports, 'CHII_PROXY_PATH', {
|
|
386
|
+
enumerable: true,
|
|
387
|
+
get: function () {
|
|
388
|
+
return CHII_PROXY_PATH;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
364
391
|
Object.defineProperty(exports, 'createProxyMiddleware', {
|
|
365
392
|
enumerable: true,
|
|
366
393
|
get: function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getChromeDevtoolsHtml } from "./__chrome_devtools-
|
|
2
|
-
import { colorUrl, isNuxtProject } from "./utils-
|
|
1
|
+
import { getChromeDevtoolsHtml } from "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { colorUrl, getProjectHash, isNuxtProject } from "./utils-DORRNjr1.js";
|
|
3
3
|
import { ServerResponse } from "node:http";
|
|
4
4
|
import { Socket, createServer } from "node:net";
|
|
5
5
|
import process$1 from "node:process";
|
|
@@ -10,7 +10,7 @@ import c from "picocolors";
|
|
|
10
10
|
import { createUnplugin } from "unplugin";
|
|
11
11
|
import { start } from "z-chii";
|
|
12
12
|
|
|
13
|
-
//#region node_modules/.pnpm/get-port-please@3.2
|
|
13
|
+
//#region node_modules/.pnpm/get-port-please@3.1.2/node_modules/get-port-please/dist/index.mjs
|
|
14
14
|
const unsafePorts = /* @__PURE__ */ new Set([
|
|
15
15
|
1,
|
|
16
16
|
7,
|
|
@@ -99,12 +99,23 @@ function isUnsafePort(port) {
|
|
|
99
99
|
function isSafePort(port) {
|
|
100
100
|
return !isUnsafePort(port);
|
|
101
101
|
}
|
|
102
|
+
var __defProp = Object.defineProperty;
|
|
103
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
configurable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
value
|
|
108
|
+
}) : obj[key] = value;
|
|
109
|
+
var __publicField = (obj, key, value) => {
|
|
110
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
111
|
+
return value;
|
|
112
|
+
};
|
|
102
113
|
var GetPortError = class extends Error {
|
|
103
114
|
constructor(message, opts) {
|
|
104
115
|
super(message, opts);
|
|
105
116
|
this.message = message;
|
|
117
|
+
__publicField(this, "name", "GetPortError");
|
|
106
118
|
}
|
|
107
|
-
name = "GetPortError";
|
|
108
119
|
};
|
|
109
120
|
function _log(verbose, message) {
|
|
110
121
|
if (verbose) console.log(`[get-port] ${message}`);
|
|
@@ -129,7 +140,7 @@ function _tryPort(port, host) {
|
|
|
129
140
|
}
|
|
130
141
|
function _getLocalHosts(additional) {
|
|
131
142
|
const hosts = new Set(additional);
|
|
132
|
-
for (const _interface of Object.values(networkInterfaces())) for (const config$1 of _interface || []) if (config$1.address && !config$1.internal && !config$1.address.startsWith("fe80::")
|
|
143
|
+
for (const _interface of Object.values(networkInterfaces())) for (const config$1 of _interface || []) if (config$1.address && !config$1.internal && !config$1.address.startsWith("fe80::")) hosts.add(config$1.address);
|
|
133
144
|
return [...hosts];
|
|
134
145
|
}
|
|
135
146
|
function _fmtOnHost(hostname) {
|
|
@@ -157,23 +168,27 @@ async function checkPort(port, host = process.env.HOST, verbose) {
|
|
|
157
168
|
//#endregion
|
|
158
169
|
//#region src/index.ts
|
|
159
170
|
const cwd = process$1.cwd();
|
|
171
|
+
const projectHash = getProjectHash();
|
|
172
|
+
const CHII_PROXY_PATH = `/__chii_proxy_${projectHash}`;
|
|
173
|
+
const CHII_DEVTOOLS_PATH = `/__chrome_devtools_${projectHash}`;
|
|
174
|
+
const VIRTUAL_CHII_CLIENT = `/__chii_client_${projectHash}.js`;
|
|
160
175
|
let config;
|
|
161
176
|
const resovedInfo = {
|
|
162
177
|
availablePort: void 0,
|
|
163
178
|
targetURL: void 0
|
|
164
179
|
};
|
|
165
|
-
function createProxyMiddleware(debug) {
|
|
180
|
+
function createProxyMiddleware(debug, proxyPath) {
|
|
166
181
|
let proxy = null;
|
|
167
182
|
const handleUpgrade = (req, socket, head) => {
|
|
168
|
-
if (proxy && req.url?.startsWith(
|
|
183
|
+
if (proxy && req.url?.startsWith(proxyPath)) {
|
|
169
184
|
debug("WS upgrade:", req.url);
|
|
170
|
-
req.url = req.url.replace(
|
|
185
|
+
req.url = req.url.replace(proxyPath, "");
|
|
171
186
|
proxy.ws(req, socket, head);
|
|
172
187
|
}
|
|
173
188
|
};
|
|
174
189
|
return (resolvedInfo) => {
|
|
175
190
|
return (req, res, next) => {
|
|
176
|
-
if (req.url?.startsWith(
|
|
191
|
+
if (req.url?.startsWith(proxyPath)) req._skip_transform = true;
|
|
177
192
|
if (!proxy && resolvedInfo.availablePort) {
|
|
178
193
|
proxy = httpProxy.createProxyServer({
|
|
179
194
|
target: `http://localhost:${resolvedInfo.availablePort}`,
|
|
@@ -188,9 +203,9 @@ function createProxyMiddleware(debug) {
|
|
|
188
203
|
});
|
|
189
204
|
if (req.socket.server) req.socket.server.on("upgrade", handleUpgrade);
|
|
190
205
|
}
|
|
191
|
-
if (proxy && req.url?.startsWith(
|
|
206
|
+
if (proxy && req.url?.startsWith(proxyPath)) {
|
|
192
207
|
debug(req.url);
|
|
193
|
-
req.url = req.url.replace(
|
|
208
|
+
req.url = req.url.replace(proxyPath, "");
|
|
194
209
|
proxy.web(req, res);
|
|
195
210
|
} else next();
|
|
196
211
|
};
|
|
@@ -207,18 +222,18 @@ const unpluginFactory = (options) => {
|
|
|
207
222
|
name: "unplugin-dingtalk",
|
|
208
223
|
enforce: "pre",
|
|
209
224
|
resolveId(source) {
|
|
210
|
-
if (source === "chii-client") return
|
|
225
|
+
if (source === "chii-client" || source === VIRTUAL_CHII_CLIENT) return VIRTUAL_CHII_CLIENT;
|
|
211
226
|
},
|
|
212
227
|
loadInclude(id) {
|
|
213
|
-
return id ===
|
|
228
|
+
return id === VIRTUAL_CHII_CLIENT;
|
|
214
229
|
},
|
|
215
230
|
load(id) {
|
|
216
|
-
if (id ===
|
|
231
|
+
if (id === VIRTUAL_CHII_CLIENT) return `
|
|
217
232
|
;(function(){
|
|
218
233
|
if (document.getElementById('__chii_client')) return;
|
|
219
234
|
const script = document.createElement('script');
|
|
220
235
|
script.id = '__chii_client';
|
|
221
|
-
script.src="/
|
|
236
|
+
script.src="${CHII_PROXY_PATH}/target.js";
|
|
222
237
|
${options?.chii?.embedded ? "script.setAttribute('embedded','true');" : ""}
|
|
223
238
|
document.body.appendChild(script);
|
|
224
239
|
})();
|
|
@@ -228,7 +243,7 @@ if (import.meta.hot) {
|
|
|
228
243
|
if (old) old.remove();
|
|
229
244
|
const script = document.createElement('script');
|
|
230
245
|
script.id = '__chii_client';
|
|
231
|
-
script.src="/
|
|
246
|
+
script.src="${CHII_PROXY_PATH}/target.js";
|
|
232
247
|
${options?.chii?.embedded ? "script.setAttribute('embedded','true');" : ""}
|
|
233
248
|
document.body.appendChild(script);
|
|
234
249
|
});
|
|
@@ -247,7 +262,7 @@ if (import.meta.hot) {
|
|
|
247
262
|
if (options?.enable && enableChii) {
|
|
248
263
|
const file = id.split("?")[0];
|
|
249
264
|
if (file.startsWith(config?.root || cwd) && !file.includes("node_modules") && file.match(/\.[t|j]s$/) && !isNuxt) return {
|
|
250
|
-
code: `import '
|
|
265
|
+
code: `import '${VIRTUAL_CHII_CLIENT}';\n${source}`,
|
|
251
266
|
map: null
|
|
252
267
|
};
|
|
253
268
|
}
|
|
@@ -262,7 +277,7 @@ if (import.meta.hot) {
|
|
|
262
277
|
},
|
|
263
278
|
transformIndexHtml(html) {
|
|
264
279
|
if (options?.enable && enableChii && !isNuxt) {
|
|
265
|
-
const tag =
|
|
280
|
+
const tag = `<script type="module">import '${VIRTUAL_CHII_CLIENT}';<\/script>`;
|
|
266
281
|
if (!html.includes(tag)) return html.replace("</body>", `</body>${tag}\n`);
|
|
267
282
|
}
|
|
268
283
|
return html;
|
|
@@ -281,7 +296,7 @@ if (import.meta.hot) {
|
|
|
281
296
|
server.printUrls = () => {
|
|
282
297
|
_printUrls();
|
|
283
298
|
console.log(` ${c.green("➜")} ${c.bold("Open in dingtalk")}: ${colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
284
|
-
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source}${base}
|
|
299
|
+
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source}${base}${CHII_DEVTOOLS_PATH.replace(/^\//, "")}`)}`);
|
|
285
300
|
};
|
|
286
301
|
const targetURL = new URL(_targetUrl);
|
|
287
302
|
targetURL.searchParams.append("ddtab", "true");
|
|
@@ -295,18 +310,18 @@ if (import.meta.hot) {
|
|
|
295
310
|
next();
|
|
296
311
|
});
|
|
297
312
|
if (enableChii) {
|
|
298
|
-
server.middlewares.use(
|
|
313
|
+
server.middlewares.use(CHII_DEVTOOLS_PATH, async (_req, res) => {
|
|
299
314
|
if (!resovedInfo.availablePort) {
|
|
300
315
|
res.writeHead(500, { "Content-Type": "text/plain" });
|
|
301
316
|
res.end("Server not started");
|
|
302
317
|
return;
|
|
303
318
|
}
|
|
304
319
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
305
|
-
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort));
|
|
320
|
+
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort, CHII_PROXY_PATH));
|
|
306
321
|
res.end();
|
|
307
322
|
});
|
|
308
323
|
if (!isNuxt) {
|
|
309
|
-
const proxyMiddleware = createProxyMiddleware(debug);
|
|
324
|
+
const proxyMiddleware = createProxyMiddleware(debug, CHII_PROXY_PATH);
|
|
310
325
|
server.middlewares.use(proxyMiddleware(resovedInfo));
|
|
311
326
|
}
|
|
312
327
|
}
|
|
@@ -330,7 +345,7 @@ if (import.meta.hot) {
|
|
|
330
345
|
const _targetUrl = options?.targetUrl ?? `http://${source}${base}`;
|
|
331
346
|
compiler.hooks.done.tap("unplugin-dingtalk", () => {
|
|
332
347
|
console.log(` ${c.green("➜")} ${c.bold("Open in dingtalk")}: ${colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
333
|
-
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source}${base}
|
|
348
|
+
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source}${base}${CHII_DEVTOOLS_PATH.replace(/^\//, "")}`)}`);
|
|
334
349
|
});
|
|
335
350
|
resovedInfo.targetURL = new URL(_targetUrl);
|
|
336
351
|
resovedInfo.targetURL.searchParams.append("ddtab", "true");
|
|
@@ -351,7 +366,7 @@ if (import.meta.hot) {
|
|
|
351
366
|
resovedInfo.targetURL.searchParams.append("ddtab", "true");
|
|
352
367
|
if (options?.corpId) resovedInfo.targetURL.searchParams.append("corpId", options.corpId);
|
|
353
368
|
console.log(` ${c.green("➜")} ${c.bold("Open in dingtalk")}: ${colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
354
|
-
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source}${base}
|
|
369
|
+
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source}${base}${CHII_DEVTOOLS_PATH.replace(/^\//, "")}`)}`);
|
|
355
370
|
}
|
|
356
371
|
};
|
|
357
372
|
return unpluginDing;
|
|
@@ -360,4 +375,4 @@ const unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
|
|
|
360
375
|
var src_default = unplugin;
|
|
361
376
|
|
|
362
377
|
//#endregion
|
|
363
|
-
export { createProxyMiddleware, resovedInfo, src_default, unplugin, unpluginFactory };
|
|
378
|
+
export { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, createProxyMiddleware, resovedInfo, src_default, unplugin, unpluginFactory };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
2
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
3
3
|
const picocolors = require_chunk.__toESM(require("picocolors"));
|
|
4
|
+
const node_crypto = require_chunk.__toESM(require("node:crypto"));
|
|
4
5
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
5
6
|
|
|
6
7
|
//#region src/utils.ts
|
|
8
|
+
function getProjectHash() {
|
|
9
|
+
return (0, node_crypto.createHash)("md5").update(node_process.default.cwd()).digest("hex").slice(0, 8);
|
|
10
|
+
}
|
|
7
11
|
async function interopDefault(m) {
|
|
8
12
|
const resolved = await m;
|
|
9
13
|
return resolved.default || resolved;
|
|
@@ -27,6 +31,12 @@ Object.defineProperty(exports, 'colorUrl', {
|
|
|
27
31
|
return colorUrl;
|
|
28
32
|
}
|
|
29
33
|
});
|
|
34
|
+
Object.defineProperty(exports, 'getProjectHash', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return getProjectHash;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
30
40
|
Object.defineProperty(exports, 'interopDefault', {
|
|
31
41
|
enumerable: true,
|
|
32
42
|
get: function () {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import c from "picocolors";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
3
4
|
import { existsSync } from "node:fs";
|
|
4
5
|
|
|
5
6
|
//#region src/utils.ts
|
|
7
|
+
function getProjectHash() {
|
|
8
|
+
return createHash("md5").update(process.cwd()).digest("hex").slice(0, 8);
|
|
9
|
+
}
|
|
6
10
|
async function interopDefault(m) {
|
|
7
11
|
const resolved = await m;
|
|
8
12
|
return resolved.default || resolved;
|
|
@@ -20,4 +24,4 @@ function isNuxtProject() {
|
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
//#endregion
|
|
23
|
-
export { colorUrl, interopDefault, isNuxtProject };
|
|
27
|
+
export { colorUrl, getProjectHash, interopDefault, isNuxtProject };
|
package/dist/utils.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const require_utils = require('./utils-
|
|
1
|
+
const require_utils = require('./utils-3gBRwB2B.cjs');
|
|
2
2
|
|
|
3
3
|
exports.colorUrl = require_utils.colorUrl;
|
|
4
|
+
exports.getProjectHash = require_utils.getProjectHash;
|
|
4
5
|
exports.interopDefault = require_utils.interopDefault;
|
|
5
6
|
exports.isNuxtProject = require_utils.isNuxtProject;
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
//#region src/utils.d.ts
|
|
2
2
|
type Awaitable<T> = T | Promise<T>;
|
|
3
|
+
declare function getProjectHash(): string;
|
|
3
4
|
declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
4
5
|
default: infer U;
|
|
5
6
|
} ? U : T>;
|
|
6
7
|
declare const colorUrl: (url: string) => string;
|
|
7
8
|
declare function isNuxtProject(): boolean;
|
|
8
9
|
//#endregion
|
|
9
|
-
export { Awaitable, colorUrl, interopDefault, isNuxtProject };
|
|
10
|
+
export { Awaitable, colorUrl, getProjectHash, interopDefault, isNuxtProject };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
//#region src/utils.d.ts
|
|
2
2
|
type Awaitable<T> = T | Promise<T>;
|
|
3
|
+
declare function getProjectHash(): string;
|
|
3
4
|
declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
4
5
|
default: infer U;
|
|
5
6
|
} ? U : T>;
|
|
6
7
|
declare const colorUrl: (url: string) => string;
|
|
7
8
|
declare function isNuxtProject(): boolean;
|
|
8
9
|
//#endregion
|
|
9
|
-
export { Awaitable, colorUrl, interopDefault, isNuxtProject };
|
|
10
|
+
export { Awaitable, colorUrl, getProjectHash, interopDefault, isNuxtProject };
|
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { colorUrl, interopDefault, isNuxtProject } from "./utils-
|
|
1
|
+
import { colorUrl, getProjectHash, interopDefault, isNuxtProject } from "./utils-DORRNjr1.js";
|
|
2
2
|
|
|
3
|
-
export { colorUrl, interopDefault, isNuxtProject };
|
|
3
|
+
export { colorUrl, getProjectHash, interopDefault, isNuxtProject };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { unpluginFactory } from "./src-
|
|
2
|
-
import { interopDefault } from "./utils-
|
|
1
|
+
import { unpluginFactory } from "./src-DD2TG884.js";
|
|
2
|
+
import { interopDefault } from "./utils-DORRNjr1.js";
|
|
3
3
|
import { createVitePlugin } from "unplugin";
|
|
4
4
|
|
|
5
5
|
//#region src/vite.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_src = require('./src-
|
|
3
|
-
const require_utils = require('./utils-
|
|
2
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
3
|
+
const require_utils = require('./utils-3gBRwB2B.cjs');
|
|
4
4
|
const unplugin = require_chunk.__toESM(require("unplugin"));
|
|
5
5
|
|
|
6
6
|
//#region src/vite.ts
|
package/dist/vite.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require('./__chrome_devtools-
|
|
2
|
-
require('./src-
|
|
3
|
-
require('./utils-
|
|
4
|
-
const require_vite = require('./vite-
|
|
1
|
+
require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
2
|
+
require('./src-7U04DWRB.cjs');
|
|
3
|
+
require('./utils-3gBRwB2B.cjs');
|
|
4
|
+
const require_vite = require('./vite-Ds1Kt2Lk.cjs');
|
|
5
5
|
|
|
6
6
|
module.exports = require_vite.vite_default;
|
package/dist/vite.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./__chrome_devtools-
|
|
2
|
-
import "./src-
|
|
3
|
-
import "./utils-
|
|
4
|
-
import { vite_default } from "./vite-
|
|
1
|
+
import "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import "./src-DD2TG884.js";
|
|
3
|
+
import "./utils-DORRNjr1.js";
|
|
4
|
+
import { vite_default } from "./vite-BqXPfqlC.js";
|
|
5
5
|
|
|
6
6
|
export { vite_default as default };
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require___chrome_devtools = require('./__chrome_devtools-
|
|
3
|
-
const require_src = require('./src-
|
|
4
|
-
require('./utils-
|
|
2
|
+
const require___chrome_devtools = require('./__chrome_devtools-DXNY3hbb.cjs');
|
|
3
|
+
const require_src = require('./src-7U04DWRB.cjs');
|
|
4
|
+
require('./utils-3gBRwB2B.cjs');
|
|
5
5
|
const cookie = require_chunk.__toESM(require("cookie"));
|
|
6
6
|
const picocolors = require_chunk.__toESM(require("picocolors"));
|
|
7
7
|
const unplugin = require_chunk.__toESM(require("unplugin"));
|
|
@@ -24,10 +24,10 @@ var webpack_default = (options) => {
|
|
|
24
24
|
next();
|
|
25
25
|
});
|
|
26
26
|
if (enableChii) {
|
|
27
|
-
devServer.app.get(
|
|
27
|
+
devServer.app.get(require_src.CHII_DEVTOOLS_PATH, async (_req, res) => {
|
|
28
28
|
try {
|
|
29
29
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
30
|
-
res.write(require___chrome_devtools.getChromeDevtoolsHtml(require_src.resovedInfo.availablePort));
|
|
30
|
+
res.write(require___chrome_devtools.getChromeDevtoolsHtml(require_src.resovedInfo.availablePort, require_src.CHII_PROXY_PATH));
|
|
31
31
|
res.end();
|
|
32
32
|
} catch (error) {
|
|
33
33
|
debug(`${error}`);
|
|
@@ -35,7 +35,7 @@ var webpack_default = (options) => {
|
|
|
35
35
|
res.end();
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
const proxyMiddleware = require_src.createProxyMiddleware(debug);
|
|
38
|
+
const proxyMiddleware = require_src.createProxyMiddleware(debug, require_src.CHII_PROXY_PATH);
|
|
39
39
|
devServer.app.use(proxyMiddleware(require_src.resovedInfo));
|
|
40
40
|
}
|
|
41
41
|
devServer.app.get("/open-dingtalk", (req, res) => {
|
package/dist/webpack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getChromeDevtoolsHtml } from "./__chrome_devtools-
|
|
2
|
-
import { createProxyMiddleware, resovedInfo, unpluginFactory } from "./src-
|
|
3
|
-
import "./utils-
|
|
1
|
+
import { getChromeDevtoolsHtml } from "./__chrome_devtools-DtQ6IXAu.js";
|
|
2
|
+
import { CHII_DEVTOOLS_PATH, CHII_PROXY_PATH, createProxyMiddleware, resovedInfo, unpluginFactory } from "./src-DD2TG884.js";
|
|
3
|
+
import "./utils-DORRNjr1.js";
|
|
4
4
|
import cookie from "cookie";
|
|
5
5
|
import c from "picocolors";
|
|
6
6
|
import { createWebpackPlugin } from "unplugin";
|
|
@@ -23,10 +23,10 @@ var webpack_default = (options) => {
|
|
|
23
23
|
next();
|
|
24
24
|
});
|
|
25
25
|
if (enableChii) {
|
|
26
|
-
devServer.app.get(
|
|
26
|
+
devServer.app.get(CHII_DEVTOOLS_PATH, async (_req, res) => {
|
|
27
27
|
try {
|
|
28
28
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
29
|
-
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort));
|
|
29
|
+
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort, CHII_PROXY_PATH));
|
|
30
30
|
res.end();
|
|
31
31
|
} catch (error) {
|
|
32
32
|
debug(`${error}`);
|
|
@@ -34,7 +34,7 @@ var webpack_default = (options) => {
|
|
|
34
34
|
res.end();
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
const proxyMiddleware = createProxyMiddleware(debug);
|
|
37
|
+
const proxyMiddleware = createProxyMiddleware(debug, CHII_PROXY_PATH);
|
|
38
38
|
devServer.app.use(proxyMiddleware(resovedInfo));
|
|
39
39
|
}
|
|
40
40
|
devServer.app.get("/open-dingtalk", (req, res) => {
|