Archived
1
0

Add caching

This commit is contained in:
Asher
2019-09-06 17:41:22 -05:00
parent 44000459da
commit 12e608468b
2 changed files with 35 additions and 19 deletions

View File

@ -151,15 +151,17 @@ index 1d9a0b8308..d8204187c6 100644
</head>
diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js
index 2f09f53e43..ca969f19f6 100644
index 2f09f53e43..0f5eef1c9e 100644
--- a/src/vs/code/browser/workbench/workbench.js
+++ b/src/vs/code/browser/workbench/workbench.js
@@ -8,24 +8,52 @@
@@ -8,24 +8,53 @@
(function () {
+ const basePath = window.location.pathname.replace(/\/+$/, '');
+ const base = window.location.origin + basePath;
+ const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings'));
+ options.webviewEndpoint = `${base}/webview/`;
+ let nlsConfig;
+ try {
+ nlsConfig = JSON.parse(document.getElementById('vscode-remote-nls-configuration').getAttribute('data-settings'));
@ -187,9 +189,10 @@ index 2f09f53e43..ca969f19f6 100644
/** @type any */
const amdLoader = require;
+ const staticBase = base + `/static${options.productConfiguration && options.productConfiguration.commit ? `-${options.productConfiguration.commit}` : ''}`;
amdLoader.config({
- baseUrl: `${window.location.origin}/static/out`,
+ baseUrl: `${base}/static/out`,
+ baseUrl: `${staticBase}/out`,
paths: {
- 'vscode-textmate': `${window.location.origin}/static/node_modules/vscode-textmate/release/main`,
- 'onigasm-umd': `${window.location.origin}/static/node_modules/onigasm-umd/release/main`,
@ -199,20 +202,19 @@ index 2f09f53e43..ca969f19f6 100644
- 'semver-umd': `${window.location.origin}/static/node_modules/semver-umd/lib/semver-umd.js`,
- '@microsoft/applicationinsights-web': `${window.location.origin}/static/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js`,
- }
+ 'vscode-textmate': `${base}/static/node_modules/vscode-textmate/release/main`,
+ 'onigasm-umd': `${base}/static/node_modules/onigasm-umd/release/main`,
+ 'xterm': `${base}/static/node_modules/xterm/lib/xterm.js`,
+ 'xterm-addon-search': `${base}/static/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
+ 'xterm-addon-web-links': `${base}/static/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
+ 'semver-umd': `${base}/static/node_modules/semver-umd/lib/semver-umd.js`,
+ '@microsoft/applicationinsights-web': `${base}/static/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js`,
+ 'vscode-textmate': `${staticBase}/node_modules/vscode-textmate/release/main`,
+ 'onigasm-umd': `${staticBase}/node_modules/onigasm-umd/release/main`,
+ 'xterm': `${staticBase}/node_modules/xterm/lib/xterm.js`,
+ 'xterm-addon-search': `${staticBase}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
+ 'xterm-addon-web-links': `${staticBase}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
+ 'semver-umd': `${staticBase}/node_modules/semver-umd/lib/semver-umd.js`,
+ '@microsoft/applicationinsights-web': `${staticBase}/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js`,
+ },
+ 'vs/nls': nlsConfig
});
amdLoader(['vs/workbench/workbench.web.api'], function (api) {
const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings'));
+ options.webviewEndpoint = `${base}/webview/`;
- const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings'));
api.create(document.body, options);
});
})();