fix(rollup): dirnames not generate a sourcemap for the transformation (#83)

This commit is contained in:
Xin Du (Clark) 2021-01-24 19:16:39 +00:00 committed by GitHub
parent fff38618fe
commit 2d0ff10892

View File

@ -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
}
}
}
}