Skip to content

Commit

Permalink
fix: workaround, fix #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanimodori committed Feb 25, 2023
1 parent a636d80 commit 04ace1e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.ts
Expand Up @@ -5,7 +5,11 @@ import path from 'path';
export function getSourceMapString(map?: SourceMap | null): string {
if (!map) return '';
const mapDataString = JSON.stringify(map);
return `//# sourceMappingURL=data:application/json;base64,${Buffer.from(mapDataString).toString('base64')}`;
// splitted due to vite-node issue
// https://github.com/vitest-dev/vitest/issues/2918
const resultA = `//# sourceMappingURL=data:`;
const resultB = `application/json;base64,${Buffer.from(mapDataString).toString('base64')}`;
return resultA + resultB;
}

export async function writeFile(file: string, content: string) {
Expand Down

0 comments on commit 04ace1e

Please sign in to comment.