Inline codicons font for simple browser (#176462)
Should fix #139674 but need to confirm on deployed codespacespull/176483/head
parent
7114851c4a
commit
b2ea6aa9fc
|
@ -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,
|
||||
|
|
|
@ -125,7 +125,7 @@ export class SimpleBrowserView extends Disposable {
|
|||
|
||||
<meta http-equiv="Content-Security-Policy" content="
|
||||
default-src 'none';
|
||||
font-src ${this._webviewPanel.webview.cspSource};
|
||||
font-src data:;
|
||||
style-src ${this._webviewPanel.webview.cspSource};
|
||||
script-src 'nonce-${nonce}';
|
||||
frame-src *;
|
||||
|
|
Loading…
Reference in New Issue