Skip to content

Commit

Permalink
set webviewContentExternalBaseUrlTemplate (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli authored Oct 27, 2023
1 parent 8f05c12 commit 0d5bd22
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/server/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,16 @@ export default function (config: IConfig): Router.Middleware {
if (config.build.type === 'sources') {
const builtInExtensions = await getScannedBuiltinExtensions(config.build.location);
const productOverrides = await getProductOverrides(config.build.location);
ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, builtInExtensions, productOverrides);
ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, builtInExtensions, {
...productOverrides,
webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources`,
webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources/out/vs/workbench/contrib/webview/browser/pre/`
});
} else if (config.build.type === 'static') {
const baseUrl = `${ctx.protocol}://${ctx.host}/static/build`;
const baseUrlTemplate = `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build`;
ctx.state.workbench = new Workbench(baseUrl, false, config.esm, [], {
webEndpointUrlTemplate: baseUrlTemplate,
webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build`,
webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build/out/vs/workbench/contrib/webview/browser/pre/`
});
} else if (config.build.type === 'cdn') {
ctx.state.workbench = new Workbench(config.build.uri, false, config.esm);
Expand Down

0 comments on commit 0d5bd22

Please sign in to comment.