pug-site-core 1.0.11 → 1.0.12
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/lib/devServer.js +6 -5
- package/package.json +2 -2
package/lib/devServer.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
pagesPathFilter,
|
|
9
9
|
getIdleProt,
|
|
10
10
|
matchESI,
|
|
11
|
-
pathSymbol
|
|
11
|
+
pathSymbol,
|
|
12
12
|
} from "./utils.js";
|
|
13
13
|
import http from "http";
|
|
14
14
|
import WebSocket, { WebSocketServer } from "ws";
|
|
@@ -17,8 +17,9 @@ import { paths } from "./paths.js";
|
|
|
17
17
|
|
|
18
18
|
const { config } = await import(paths.config);
|
|
19
19
|
const pagsTemplatePath = paths.template.pages;
|
|
20
|
-
const localIp = ip.address();
|
|
21
|
-
const port =
|
|
20
|
+
const localIp = process.env._localIp || ip.address();
|
|
21
|
+
const port =
|
|
22
|
+
process.env._port || (await getIdleProt(config.devServer.port, localIp));
|
|
22
23
|
process.env._port = port;
|
|
23
24
|
process.env._localIp = localIp;
|
|
24
25
|
|
|
@@ -144,7 +145,7 @@ function setupRoutes(app, wss) {
|
|
|
144
145
|
{
|
|
145
146
|
data,
|
|
146
147
|
_pagePath: pugPath.split(pathSymbol + "pages")[1],
|
|
147
|
-
common: _.merge(commonData, config.commonData)
|
|
148
|
+
common: _.merge(commonData, config.commonData),
|
|
148
149
|
},
|
|
149
150
|
{ filters: getCompilePugFilter() }
|
|
150
151
|
),
|
|
@@ -201,7 +202,7 @@ async function matchFileMapTable(reqPath, language, device) {
|
|
|
201
202
|
return {
|
|
202
203
|
pugPath: obj.pugPath,
|
|
203
204
|
data,
|
|
204
|
-
getDataFn: obj.getDataFn
|
|
205
|
+
getDataFn: obj.getDataFn,
|
|
205
206
|
};
|
|
206
207
|
}
|
|
207
208
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pug-site-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"axios": "^1.7.7"
|
|
38
38
|
},
|
|
39
39
|
"license": "ISC",
|
|
40
|
-
"description": "
|
|
40
|
+
"description": "修复刷新代码切换端口bug",
|
|
41
41
|
"files": [
|
|
42
42
|
"lib/",
|
|
43
43
|
"index.js"
|