coc-live-server 0.0.7 → 0.0.9
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/lib/index.js +8 -0
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ Launch a development local Server with live reload feature for static & dynamic
|
|
|
15
15
|
- `coc-live-server.host`: server host, default: `0.0.0.0`
|
|
16
16
|
- `coc-live-server.port`: server port, default: `8080`
|
|
17
17
|
- `coc-live-server.cors`: cors, default: `false`
|
|
18
|
+
- `coc-live-server.wait`: wait, default: `100`
|
|
18
19
|
- `coc-live-server.index`: index file, default: `index.html`
|
|
19
20
|
|
|
20
21
|
## Commands
|
package/lib/index.js
CHANGED
|
@@ -56,6 +56,8 @@ function startLiveServer() {
|
|
|
56
56
|
const port = getConfigItem("port", 8080);
|
|
57
57
|
const host = getConfigItem("host", "0.0.0.0");
|
|
58
58
|
const cors = getConfigItem("cors");
|
|
59
|
+
const wait = getConfigItem("wait", 100);
|
|
60
|
+
const spa = getConfigItem("spa");
|
|
59
61
|
const index = getConfigItem("index", "index.html");
|
|
60
62
|
const STATUS = `liveServer[:${port}]`;
|
|
61
63
|
const args = [];
|
|
@@ -74,6 +76,12 @@ function startLiveServer() {
|
|
|
74
76
|
if (cors) {
|
|
75
77
|
args.push(" --cors");
|
|
76
78
|
}
|
|
79
|
+
if (spa) {
|
|
80
|
+
args.push(" --spa");
|
|
81
|
+
}
|
|
82
|
+
if (wait && typeof wait === "number") {
|
|
83
|
+
args.push(" --wait=" + wait);
|
|
84
|
+
}
|
|
77
85
|
if (index && typeof index === "string") {
|
|
78
86
|
args.push(" --index=" + index);
|
|
79
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-live-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Launch a development local Server with live reload feature for static & dynamic pages.",
|
|
5
5
|
"author": "cyl <a1008611abcd@126.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,6 +55,16 @@
|
|
|
55
55
|
"type": "string",
|
|
56
56
|
"default": "index.html",
|
|
57
57
|
"description": "Default file to serve when accessing the root URL"
|
|
58
|
+
},
|
|
59
|
+
"coc-live-server.wait": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"default": 100,
|
|
62
|
+
"description": "Wait time in milliseconds before reloading the page after a file change is detected"
|
|
63
|
+
},
|
|
64
|
+
"coc-live-server.spa": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": false,
|
|
67
|
+
"description": "translate requests from /abc to /#/abc (handy for Single Page Apps)"
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
70
|
},
|