From 2d0ff108924feec6cf21a6143d2f4acd45093faa Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Sun, 24 Jan 2021 19:16:39 +0000 Subject: [PATCH] fix(rollup): dirnames not generate a sourcemap for the transformation (#83) --- packages/nitro/src/rollup/plugins/static.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nitro/src/rollup/plugins/static.ts b/packages/nitro/src/rollup/plugins/static.ts index c2b138bedb..1e5079dfa7 100644 --- a/packages/nitro/src/rollup/plugins/static.ts +++ b/packages/nitro/src/rollup/plugins/static.ts @@ -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 + } } } }