-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Separate Source Maps' files from real files via namespace #2950
Labels
Comments
You can check (inspect with DevTools) the demo site created with this approach: https://alttiri.github.io/md5-comparison/ Here are 3 namespaces:
|
6 tasks
7 tasks
9 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think that files from Source Maps should be separated from the real files (in particular, the imports), like it is in projects built with Webpack (They are placed under
webpack://
namespace).So, "virtual files" should be displayed under, for example,
source-maps://
namespace in DevTools.Let's looks at the start project's (
yarn create @vitejs/app my-vue-app --template vue
) Source Maps.I did only one change that is adding
sourcemap: true
:build
's mode Source Maps review and one bugSpoiler
Currently for
build
it looks so:build
's Source Maps looks not bad, but if it will be placed in separate namespace it would be a bit more convenient:Since you can do not expand the original files namespace.
And the best variant (for me) is:
All project's code is in
source-maps://
,node_modules
and Vite's specific code are innode-modules://
.I did it with a simple replacement:
via my Rollup's plugin.
But the problem that I can write a plugin only for
build
, but not fordev
.By the way, did you note that App.vue was missed in the screenshots?
It's a bug! Of Vite.js. I did not reproduce this bug with pure Rollup.js.
UPD: Created an issue for it: #2959
dev
's mode Source MapsIn
dev
mode Source Maps does not look nice. Definitely. Real files are mixed with files from Source Maps.Especially I don't like that it shows absolute path to components from Source Maps.
Also for each edit of a file a new file (from an import) is created:
16 files (it can be even more — each edit is a new file until you refresh the page)!
While I need only 3:
App.vue
,HelloWorld.vue
andmain.js
.Separating of Source Maps from real files/imports are highly required here.
Also it impossible to do it with a plugin, since changing of Source Maps (changing of
sources
field) possible only ingenerateBundle
hook what does not called indev
mode.So I expect the separating files from Source Maps to a different namespace or/and an ability to do it manually with a plugin (handle the Source Maps object in
dev
mode).By the way, Webpack's ones:
Spoiler
Both do not looks nice, but it uses the separating.
dev:
It's interesting that content in
webpavk-internal://
browser handle as real files, not as files from source maps.build:
The text was updated successfully, but these errors were encountered: