Skip to content

Commit e1a85e9

Browse files
committed
fix(config): make stacktrace path correct when sourcemap is enabled
1 parent d6e6194 commit e1a85e9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/vite/src/node/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,8 @@ async function bundleConfigFile(
17201720
format: isESM ? 'esm' : 'cjs',
17211721
mainFields: ['main'],
17221722
sourcemap: 'inline',
1723+
// the last slash is needed to make the path correct
1724+
sourceRoot: pathToFileURL(path.dirname(fileName)).href + '/',
17231725
metafile: true,
17241726
define: {
17251727
__dirname: dirnameVarName,

0 commit comments

Comments
 (0)