Skip to content

Commit

Permalink
fix(vsix-plugin): set mime type in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
CompuIves committed Nov 16, 2023
1 parent e6a4a12 commit 5b8c6c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rollup-vsix-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 5b8c6c6

Please sign in to comment.