Skip to content

Commit 20fdf21

Browse files
sapphi-redbluwy
andauthored
fix(config): make stacktrace path correct when sourcemap is enabled (#18833)
Co-authored-by: Bjorn Lu <[email protected]>
1 parent 81c31c1 commit 20fdf21

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/vite/src/node/config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,8 @@ async function bundleConfigFile(
17241724
format: isESM ? 'esm' : 'cjs',
17251725
mainFields: ['main'],
17261726
sourcemap: 'inline',
1727+
// the last slash is needed to make the path correct
1728+
sourceRoot: path.dirname(fileName) + path.sep,
17271729
metafile: true,
17281730
define: {
17291731
__dirname: dirnameVarName,

0 commit comments

Comments
 (0)