mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
pimp up workbench-web.html
This commit is contained in:
parent
163aeeedac
commit
ede3632a56
|
@ -226,12 +226,14 @@ const requestHandler = (req, res) => {
|
|||
const parsedUrl = url.parse(req.url, true);
|
||||
const pathname = parsedUrl.pathname;
|
||||
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
|
||||
try {
|
||||
if (pathname === '/favicon.ico') {
|
||||
if (/(\/static)?\/favicon\.ico/.test(pathname)) {
|
||||
// favicon
|
||||
return serveFile(req, res, path.join(APP_ROOT, 'resources', 'win32', 'code.ico'));
|
||||
}
|
||||
if (pathname === '/manifest.json') {
|
||||
if (/(\/static)?\/manifest\.json/.test(pathname)) {
|
||||
// manifest
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
return res.end(JSON.stringify({
|
||||
|
|
|
@ -57,7 +57,24 @@
|
|||
<script>
|
||||
performance.mark('code/willLoadWorkbenchMain');
|
||||
</script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.nls.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.js"></script>
|
||||
|
||||
<script>
|
||||
if ("{{WORKBENCH_DEV}}" === "true") {
|
||||
const workbench = document.createElement('script');
|
||||
workbench.innerText = "require(['vs/code/browser/workbench/workbench'], function() {});";
|
||||
document.body.appendChild(workbench);
|
||||
} else {
|
||||
const nls = document.createElement('script');
|
||||
nls.setAttribute('src', '{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.nls.js');
|
||||
document.body.appendChild(nls);
|
||||
|
||||
const api = document.createElement('script');
|
||||
api.setAttribute('src', '{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.js');
|
||||
document.body.appendChild(api);
|
||||
|
||||
const workbench = document.createElement('script');
|
||||
workbench.setAttribute('src', '{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.js');
|
||||
document.body.appendChild(workbench);
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue