coc-live-server 0.1.1 → 0.1.3
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 -1
- package/lib/index.js +4 -4
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ Launch a development local Server with live reload feature for static & dynamic
|
|
|
17
17
|
- `coc-live-server.cors`: Enable CORS for the live server, default: `false`
|
|
18
18
|
- `coc-live-server.wait`: Wait time in milliseconds before reloading the page after a file change is detected, default: `100`
|
|
19
19
|
- `coc-live-server.spa`: translate requests from /abc to /#/abc (handy for Single Page Apps), default: `false`
|
|
20
|
-
- `coc-live-server.index`: Default file to serve when accessing the root URL, default: `index.html`
|
|
21
20
|
- `coc-live-server.open`: Open the browser automatically when the server starts, default: `true`
|
|
21
|
+
- `coc-live-server.log`: Enable logging for the live server
|
|
22
22
|
|
|
23
23
|
## Commands
|
|
24
24
|
|
package/lib/index.js
CHANGED
|
@@ -59,7 +59,7 @@ function startLiveServer() {
|
|
|
59
59
|
const wait = getConfigItem("wait", 100);
|
|
60
60
|
const spa = getConfigItem("spa");
|
|
61
61
|
const open = getConfigItem("open", true);
|
|
62
|
-
const
|
|
62
|
+
const log = getConfigItem("log", true);
|
|
63
63
|
const STATUS = `liveServer[:${port}]`;
|
|
64
64
|
const args = [];
|
|
65
65
|
if (liveServerProcess) {
|
|
@@ -80,15 +80,15 @@ function startLiveServer() {
|
|
|
80
80
|
if (spa) {
|
|
81
81
|
args.push(" --spa");
|
|
82
82
|
}
|
|
83
|
+
if (!log) {
|
|
84
|
+
args.push(" --quiet");
|
|
85
|
+
}
|
|
83
86
|
if (!open) {
|
|
84
87
|
args.push(" --no-browser");
|
|
85
88
|
}
|
|
86
89
|
if (wait && typeof wait === "number") {
|
|
87
90
|
args.push(" --wait=" + wait);
|
|
88
91
|
}
|
|
89
|
-
if (index && typeof index === "string") {
|
|
90
|
-
args.push(" --index=" + index);
|
|
91
|
-
}
|
|
92
92
|
args.push(` ${import_coc2.workspace.root}`);
|
|
93
93
|
liveServerProcess = (0, import_child_process.spawn)("node", [serverModule, ...args], { shell: true });
|
|
94
94
|
if (liveServerProcess) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-live-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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",
|
|
@@ -51,11 +51,6 @@
|
|
|
51
51
|
"default": false,
|
|
52
52
|
"description": "Enable CORS for the live server"
|
|
53
53
|
},
|
|
54
|
-
"coc-live-server.index": {
|
|
55
|
-
"type": "string",
|
|
56
|
-
"default": "index.html",
|
|
57
|
-
"description": "Default file to serve when accessing the root URL"
|
|
58
|
-
},
|
|
59
54
|
"coc-live-server.wait": {
|
|
60
55
|
"type": "number",
|
|
61
56
|
"default": 100,
|
|
@@ -70,6 +65,11 @@
|
|
|
70
65
|
"type": "boolean",
|
|
71
66
|
"default": true,
|
|
72
67
|
"description": "Open the browser automatically when the server starts"
|
|
68
|
+
},
|
|
69
|
+
"coc-live-server.log": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"default": true,
|
|
72
|
+
"description": "Enable logging for the live server"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
},
|