mirror of
https://github.com/Microsoft/vscode
synced 2024-08-24 19:46:05 +00:00
Add launch config/task for "yarn web"
This commit is contained in:
parent
43e85c223c
commit
84d62ea8a3
7
.vscode/launch.json
vendored
7
.vscode/launch.json
vendored
|
@ -167,6 +167,13 @@
|
|||
"web"
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch Chrome",
|
||||
"url": "http://localhost:8080",
|
||||
"preLaunchTask": "Run web"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
|
|
19
.vscode/tasks.json
vendored
19
.vscode/tasks.json
vendored
|
@ -85,5 +85,24 @@
|
|||
"task": "hygiene",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"command": "yarn web -- --no-launch",
|
||||
"label": "Run web",
|
||||
"isBackground": true,
|
||||
// This section to make error go away when launching the debug config
|
||||
"problemMatcher": {
|
||||
"pattern": {
|
||||
"regexp": ""
|
||||
},
|
||||
"background": {
|
||||
"beginsPattern": ".*node.*",
|
||||
"endsPattern": "Web UI available at .*"
|
||||
}
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "never"
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
|
@ -13,11 +13,18 @@ const fs = require('fs');
|
|||
const path = require('path');
|
||||
const util = require('util');
|
||||
const opn = require('opn');
|
||||
const minimist = require('vscode-minimist');
|
||||
|
||||
const APP_ROOT = path.dirname(__dirname);
|
||||
const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html');
|
||||
const PORT = 8080;
|
||||
|
||||
const args = minimist(process.argv, {
|
||||
string: [
|
||||
'no-launch'
|
||||
]
|
||||
});
|
||||
|
||||
const server = http.createServer((req, res) => {
|
||||
const parsedUrl = url.parse(req.url, true);
|
||||
const pathname = parsedUrl.pathname;
|
||||
|
@ -213,4 +220,6 @@ async function serveFile(req, res, filePath, responseHeaders = Object.create(nul
|
|||
}
|
||||
}
|
||||
|
||||
opn(`http://localhost:${PORT}`);
|
||||
if (args.launch !== false) {
|
||||
opn(`http://localhost:${PORT}`);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue