coc-live-server 0.1.3 → 0.1.4

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 CHANGED
@@ -18,7 +18,8 @@ Launch a development local Server with live reload feature for static & dynamic
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
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
21
+ - `coc-live-server.log`: Enable logging for the live server, default: `true`
22
+ - `coc-live-server.proxy`: proxy all requests for ROUTE to URL, default: `''`
22
23
 
23
24
  ## Commands
24
25
 
package/lib/index.js CHANGED
@@ -60,6 +60,7 @@ function startLiveServer() {
60
60
  const spa = getConfigItem("spa");
61
61
  const open = getConfigItem("open", true);
62
62
  const log = getConfigItem("log", true);
63
+ const proxy = getConfigItem("proxy", "");
63
64
  const STATUS = `liveServer[:${port}]`;
64
65
  const args = [];
65
66
  if (liveServerProcess) {
@@ -89,6 +90,9 @@ function startLiveServer() {
89
90
  if (wait && typeof wait === "number") {
90
91
  args.push(" --wait=" + wait);
91
92
  }
93
+ if (proxy && typeof proxy === "string" && proxy.trim() !== "") {
94
+ args.push(" --proxy=" + proxy);
95
+ }
92
96
  args.push(` ${import_coc2.workspace.root}`);
93
97
  liveServerProcess = (0, import_child_process.spawn)("node", [serverModule, ...args], { shell: true });
94
98
  if (liveServerProcess) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-live-server",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",
@@ -70,6 +70,11 @@
70
70
  "type": "boolean",
71
71
  "default": true,
72
72
  "description": "Enable logging for the live server"
73
+ },
74
+ "coc-live-server.proxy": {
75
+ "type": "string",
76
+ "default": "",
77
+ "description": "proxy all requests for ROUTE to URL"
73
78
  }
74
79
  }
75
80
  },