-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(config): make stacktrace path correct when sourcemap is enabled #18833
base: main
Are you sure you want to change the base?
Conversation
commit: |
I just veririfed the reproduction is fixed with pkg.pr.new, but for local playground, there's something odd regardless of $ pnpm -C playground/html dev
> @vitejs/[email protected] dev /home/hiroshi/code/others/vite/playground/html
> vite
Trace: test
at file:///home/hiroshi/code/others/vite/playground/html/node_modules/.vite-temp/file:/home/hiroshi/code/others/vite/playground/html/vite.config.js:4:9
... |
Oh, it looks like vite/packages/vite/bin/vite.js Lines 5 to 10 in b39e696
Can this be maybe changed to |
I removed the |
Ah, yeah, maybe we can migrate to it in a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
@@ -1720,6 +1720,8 @@ async function bundleConfigFile( | |||
format: isESM ? 'esm' : 'cjs', | |||
mainFields: ['main'], | |||
sourcemap: 'inline', | |||
// the last slash is needed to make the path correct | |||
sourceRoot: path.dirname(fileName) + '/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourceRoot: path.dirname(fileName) + '/', | |
sourceRoot: path.dirname(fileName) + path.sep, |
Should this use path.sep
since it could be backward slash now?
Description
fixes #18832