Skip to content

Commit

Permalink
feat(cli): enable sourcemap for ts files (close #457)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Apr 15, 2022
1 parent e1c286b commit bf8c4bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@vuepress/cli/src/utils/esbuildUtils.ts
Expand Up @@ -6,7 +6,9 @@ import { transformSync } from 'esbuild'
*/
export const transformTsFileToCodeSync = (filename: string): string =>
transformSync(fs.readFileSync(filename).toString(), {
loader: 'ts',
format: 'cjs',
loader: 'ts',
sourcefile: filename,
sourcemap: 'inline',
target: 'node12',
}).code

0 comments on commit bf8c4bc

Please sign in to comment.