Skip to content

Commit

Permalink
fix(rollup): dirnames not generate a sourcemap for the transformation (
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo authored Jan 24, 2021
1 parent f64a6ab commit a8c02df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rollup/plugins/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export function dirnames (): Plugin {
return {
name: 'dirnames',
renderChunk (code, chunk) {
return code + (chunk.isEntry ? 'global.mainDir="undefined"!=typeof __dirname?__dirname:require.main.filename;' : '')
return {
code: code + (chunk.isEntry ? 'global.mainDir="undefined"!=typeof __dirname?__dirname:require.main.filename;' : ''),
map: null
}
}
}
}

0 comments on commit a8c02df

Please sign in to comment.