-
Notifications
You must be signed in to change notification settings - Fork 111
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
workbench.ts patch now unnecessary #39
Comments
It seems like it's become even easier to consume the workbench file with the recent ESM changes that vscode has been releasing over the last few week. Here's what I'm doing, which does not use the vscode-web prepackaged assets at all.
And replace:
with your config object:
then, you can use the official built assets from the |
It looks like you can also get the latest build url by going to: |
In my case, I also add to set the following global var: globalThis._VSCODE_WEB_PACKAGE_TTP = window.trustedTypes?.createPolicy('amdLoader', {
createScriptURL(value) {
return value;
}
}) Otherwise I was not able to load assets from a CDN. |
I don't know when this was introduced, but the stock
workbench.ts
will pull config from a data attribute of an element with idvscode-workbench-web-configuration
. So I do a synchronous fetch ofproduct.json
(though maybe better to nameworkbench.json
) in theindex.html
before the VSCode sources are loaded. If I understand correctly, this achieves the same result of the patchedworkbench.ts
you have without patching/replacing it.https://github.com/progrium/vscode-web/blob/main/patched/index.html#L27-L40
The text was updated successfully, but these errors were encountered: