Skip to content

Commit 43af6fc

Browse files
committed
Fix issue where path slash is required.
1 parent 479b6a8 commit 43af6fc

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/vs/code/browser/workbench/workbench-dev.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
<script src="./static/out/vs/loader.js"></script>
4343
<script src="./static/out/vs/webPackagePaths.js"></script>
4444
<script>
45-
const baseUrl = new URL(window.location.href);
46-
baseUrl.search = '';
47-
baseUrl.hash = '';
48-
45+
/**
46+
* Updated to use relative path.
47+
* @author coder
48+
*/
4949
Object.keys(self.webPackagePaths).map(function (key, index) {
50-
self.webPackagePaths[key] = `${baseUrl.href}static/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
50+
self.webPackagePaths[key] = new URL(`./static/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`, window.location.href).toString();
5151
});
5252
require.config({
53-
baseUrl: `${baseUrl.href}static/out`,
53+
baseUrl: new URL('./static/out', window.location.href).toString(),
5454
recordStats: true,
5555
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
5656
createScriptURL(value) {

src/vs/code/browser/workbench/workbench.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
<script src="./static/out/vs/loader.js"></script>
4242
<script src="./static/out/vs/webPackagePaths.js"></script>
4343
<script>
44-
const baseUrl = new URL(window.location.href);
45-
baseUrl.search = '';
46-
baseUrl.hash = '';
47-
44+
/**
45+
* Updated to use relative path.
46+
* @author coder
47+
*/
4848
Object.keys(self.webPackagePaths).map(function (key, index) {
49-
self.webPackagePaths[key] = `${baseUrl.href}static/node_modules/${key}/${self.webPackagePaths[key]}`;
49+
self.webPackagePaths[key] = new URL(`./static/node_modules/${key}/${self.webPackagePaths[key]}`, window.location.href).toString();
5050
});
5151
require.config({
52-
baseUrl: `${baseUrl.href}static/out`,
52+
baseUrl: new URL('./static/out', window.location.href).toString(),
5353
recordStats: true,
5454
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
5555
createScriptURL(value) {

0 commit comments

Comments
 (0)