diff --git a/src/server/workbench.ts b/src/server/workbench.ts index b30f105..e579d1b 100644 --- a/src/server/workbench.ts +++ b/src/server/workbench.ts @@ -44,8 +44,7 @@ class Workbench { WORKBENCH_AUTH_SESSION: '', WORKBENCH_WEB_BASE_URL: this.baseUrl, WORKBENCH_BUILTIN_EXTENSIONS: asJSON(this.builtInExtensions), - WORKBENCH_MAIN: this.getMain(), - WORKBENCH_DEV_CSS_MODULES: JSON.stringify(this.devCSSModules) + WORKBENCH_MAIN: this.getMain() }; try { @@ -58,7 +57,30 @@ class Workbench { getMain() { if (this.esm) { - return ``; + const lines = this.devCSSModules.length > 0 ? [ + "", + "" + ] : []; + lines.push(``); + return lines.join('\n'); } if (this.dev) { return ``; @@ -139,7 +161,7 @@ export default function (config: IConfig): Router.Middleware { const productOverrides = await getProductOverrides(config.build.location); const esm = config.esm || await isESM(config.build.location); console.log('Using ESM loader:', esm); - const devCSSModules = config.esm ? await getDevCssModules(config.build.location) : []; + const devCSSModules = esm ? await getDevCssModules(config.build.location) : []; ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, esm, devCSSModules, builtInExtensions, { ...productOverrides, webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources`, diff --git a/views/workbench-esm.html b/views/workbench-esm.html index 5dc0c7a..83040e6 100644 --- a/views/workbench-esm.html +++ b/views/workbench-esm.html @@ -41,26 +41,6 @@ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString(); globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/'; -