Merge pull request #3879 from microsoft/hediet/webcomponent-bugfix

Fixes webcomponent sample for local development
This commit is contained in:
Henning Dieterichs 2023-04-05 12:06:35 +02:00 committed by GitHub
commit 1c6f48aa7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -14,6 +14,8 @@ import { exit } from "process";
"yarn", "yarn",
[ [
"tsc", "tsc",
"--target",
"es6",
"--noEmit", "--noEmit",
"--allowJs", "--allowJs",
"--checkJs", "--checkJs",

View file

@ -11,10 +11,12 @@ customElements.define(
const shadowRoot = this.attachShadow({ mode: "open" }); const shadowRoot = this.attachShadow({ mode: "open" });
// Copy over editor styles // Copy over editor styles
const style = document.querySelector( const styles = document.querySelectorAll(
"link[rel='stylesheet'][data-name='vs/editor/editor.main']" "link[rel='stylesheet'][data-name^='vs/']"
); );
for (const style of styles) {
shadowRoot.appendChild(style.cloneNode(true)); shadowRoot.appendChild(style.cloneNode(true));
}
const template = /** @type HTMLTemplateElement */ ( const template = /** @type HTMLTemplateElement */ (
document.getElementById("editor-template") document.getElementById("editor-template")