From 5b8c6c62532ce5077d17de992221f9c129d4f71c Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Thu, 16 Nov 2023 17:01:48 +0100 Subject: [PATCH] fix(vsix-plugin): set mime type in dev mode --- src/rollup-vsix-plugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rollup-vsix-plugin.ts b/src/rollup-vsix-plugin.ts index c8918db7..45a21691 100644 --- a/src/rollup-vsix-plugin.ts +++ b/src/rollup-vsix-plugin.ts @@ -101,7 +101,8 @@ export default function plugin ({ const assetPath = getVsixPath(resource.realPath ?? resource.path) let url: string if (process.env.NODE_ENV === 'development') { - url = `'data:text/javascript;base64,${readFileSync(assetPath).toString('base64')}'` + const fileType = resource.mimeType ?? 'text/javascript' + url = `'data:${fileType};base64,${readFileSync(assetPath).toString('base64')}'` } else { url = 'import.meta.ROLLUP_FILE_URL_' + this.emitFile({ type: 'asset',