Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set webviewContentExternalBaseUrlTemplate #110

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading