Skip to content

Commit

Permalink
Merge pull request #250 from CompuIves/fix/mime-type
Browse files Browse the repository at this point in the history
fix(vsix-plugin): set mime type in dev mode
  • Loading branch information
CGNonofr authored Nov 16, 2023
2 parents e6a4a12 + 5b8c6c6 commit f2395e3
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 f2395e3

Please sign in to comment.