@modern-js/plugin-proxy 2.35.0 → 2.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js
CHANGED
|
@@ -39,10 +39,9 @@ const proxyPlugin = () => {
|
|
|
39
39
|
];
|
|
40
40
|
},
|
|
41
41
|
async afterDev() {
|
|
42
|
-
var _dev;
|
|
43
42
|
const { dev } = api.useResolvedConfigContext();
|
|
44
43
|
const { internalDirectory } = api.useAppContext();
|
|
45
|
-
if (!(
|
|
44
|
+
if (!(dev === null || dev === void 0 ? void 0 : dev.proxy)) {
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
47
|
const rule = (0, _createProxyRule.createProxyRule)(internalDirectory, dev.proxy);
|
|
@@ -55,8 +54,7 @@ const proxyPlugin = () => {
|
|
|
55
54
|
}
|
|
56
55
|
},
|
|
57
56
|
beforeExit() {
|
|
58
|
-
|
|
59
|
-
(_proxyServer = proxyServer) === null || _proxyServer === void 0 ? void 0 : _proxyServer.close();
|
|
57
|
+
proxyServer === null || proxyServer === void 0 ? void 0 : proxyServer.close();
|
|
60
58
|
}
|
|
61
59
|
})
|
|
62
60
|
};
|
|
@@ -28,12 +28,12 @@ class WhistleProxy {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
async start() {
|
|
31
|
-
_utils.logger.info(`Starting
|
|
31
|
+
_utils.logger.info(`Starting proxy server.....`);
|
|
32
32
|
(0, _execSync.default)(`${this.bin} start --certDir=${this.certDir} --port=${this.port}`);
|
|
33
33
|
(0, _execSync.default)(`${this.bin} use ${this.rule} --force`);
|
|
34
34
|
await this.installRootCA();
|
|
35
35
|
enableGlobalProxy("localhost", this.port);
|
|
36
|
-
_utils.logger.info(`Proxy
|
|
36
|
+
_utils.logger.info(`Proxy server start on localhost:${this.port}
|
|
37
37
|
`);
|
|
38
38
|
}
|
|
39
39
|
close() {
|
package/dist/esm/index.js
CHANGED
|
@@ -19,10 +19,9 @@ export const proxyPlugin = () => {
|
|
|
19
19
|
];
|
|
20
20
|
},
|
|
21
21
|
async afterDev() {
|
|
22
|
-
var _dev;
|
|
23
22
|
const { dev } = api.useResolvedConfigContext();
|
|
24
23
|
const { internalDirectory } = api.useAppContext();
|
|
25
|
-
if (!(
|
|
24
|
+
if (!(dev === null || dev === void 0 ? void 0 : dev.proxy)) {
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
27
|
const rule = createProxyRule(internalDirectory, dev.proxy);
|
|
@@ -35,8 +34,7 @@ export const proxyPlugin = () => {
|
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
beforeExit() {
|
|
38
|
-
|
|
39
|
-
(_proxyServer = proxyServer) === null || _proxyServer === void 0 ? void 0 : _proxyServer.close();
|
|
37
|
+
proxyServer === null || proxyServer === void 0 ? void 0 : proxyServer.close();
|
|
40
38
|
}
|
|
41
39
|
})
|
|
42
40
|
};
|
|
@@ -17,12 +17,12 @@ class WhistleProxy {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
async start() {
|
|
20
|
-
logger.info(`Starting
|
|
20
|
+
logger.info(`Starting proxy server.....`);
|
|
21
21
|
execSync(`${this.bin} start --certDir=${this.certDir} --port=${this.port}`);
|
|
22
22
|
execSync(`${this.bin} use ${this.rule} --force`);
|
|
23
23
|
await this.installRootCA();
|
|
24
24
|
enableGlobalProxy("localhost", this.port);
|
|
25
|
-
logger.info(`Proxy
|
|
25
|
+
logger.info(`Proxy server start on localhost:${this.port}
|
|
26
26
|
`);
|
|
27
27
|
}
|
|
28
28
|
close() {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.35.
|
|
18
|
+
"version": "2.35.1",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"whistle": "^2.7.18",
|
|
38
38
|
"@swc/helpers": "0.5.1",
|
|
39
|
-
"@modern-js/utils": "2.35.
|
|
39
|
+
"@modern-js/utils": "2.35.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/jest": "^29",
|
|
43
43
|
"@types/node": "^14",
|
|
44
44
|
"typescript": "^5",
|
|
45
45
|
"jest": "^29",
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@scripts/
|
|
46
|
+
"@modern-js/core": "2.35.1",
|
|
47
|
+
"@scripts/build": "2.35.1",
|
|
48
|
+
"@scripts/jest-config": "2.35.1"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
51
|
"publishConfig": {
|