Skip to content

Commit

Permalink
fix: correctly convert string to base64
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Apr 28, 2021
1 parent fc216bc commit f4ead25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ export const bundle = async (
if (transformed.code) {
let code = transformed.code
if (transformed.map) {
const map = btoa(
const map = Buffer.from(
typeof transformed.map === 'string'
? transformed.map
: JSON.stringify(transformed.map)
)
).toString('base64')
code += `\n//# sourceMappingURL=data:application/json;base64,${map}`
}
return {
Expand Down

0 comments on commit f4ead25

Please sign in to comment.