Skip to content
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

File path in the browser module file #16578

Closed
4 tasks done
Polygons1 opened this issue May 2, 2024 · 1 comment
Closed
4 tasks done

File path in the browser module file #16578

Polygons1 opened this issue May 2, 2024 · 1 comment

Comments

@Polygons1
Copy link

Description

sometimes in a big projects with tons of dependencies there is a problem to point to the exact file with the error, so by adding the file path (relative to the project) it will help to point into the exact file

Suggested solution

in the JavaScript module files for the browser (in dev) include a comment at the top with the file name relative to the project

Alternative

No response

Additional context

No response

Validations

@bluwy
Copy link
Member

bluwy commented May 13, 2024

Adding comments to each file by default requires creating a sourcemap to map back to the original position. Vite's URL requests are usually close to the filesystem path too, so it's not hard to find the original path. Otherwise, you can also create a Vite plugin to add the comment by default. Hence, I don't think this is something Vite will support by default.

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants