From b2ea6aa9fc4c9bebc3d2c2992a891244819dbccd Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Mar 2023 19:46:53 -0800 Subject: [PATCH] Inline codicons font for simple browser (#176462) Should fix #139674 but need to confirm on deployed codespaces --- extensions/simple-browser/esbuild-preview.js | 19 +++++++------------ .../simple-browser/src/simpleBrowserView.ts | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/extensions/simple-browser/esbuild-preview.js b/extensions/simple-browser/esbuild-preview.js index 5c8bd0610ce..3133283f6b9 100644 --- a/extensions/simple-browser/esbuild-preview.js +++ b/extensions/simple-browser/esbuild-preview.js @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // @ts-check const path = require('path'); -const fs = require('fs'); const esbuild = require('esbuild'); const args = process.argv.slice(2); @@ -21,18 +20,14 @@ const srcDir = path.join(__dirname, 'preview-src'); const outDir = path.join(outputRoot, 'media'); async function build() { - fs.copyFileSync( - path.join(__dirname, 'node_modules', 'vscode-codicons', 'dist', 'codicon.css'), - path.join(outDir, 'codicon.css')); - - fs.copyFileSync( - path.join(__dirname, 'node_modules', 'vscode-codicons', 'dist', 'codicon.ttf'), - path.join(outDir, 'codicon.ttf')); - await esbuild.build({ - entryPoints: [ - path.join(srcDir, 'index.ts') - ], + entryPoints: { + 'index': path.join(srcDir, 'index.ts'), + 'codicon': path.join(__dirname, 'node_modules', 'vscode-codicons', 'dist', 'codicon.css'), + }, + loader: { + '.ttf': 'dataurl', + }, bundle: true, minify: true, sourcemap: false, diff --git a/extensions/simple-browser/src/simpleBrowserView.ts b/extensions/simple-browser/src/simpleBrowserView.ts index 28663ab39e9..eb842f6f104 100644 --- a/extensions/simple-browser/src/simpleBrowserView.ts +++ b/extensions/simple-browser/src/simpleBrowserView.ts @@ -125,7 +125,7 @@ export class SimpleBrowserView extends Disposable {