vite
vite copied to clipboard
fix(sourcemap): improve sourcemap compatibility for vue2
Description
This change does match what was in #16192 but that is marked as not resolving a different problem, so I didn't want to conflate things.
Thile using vue2, and specifically the vue2-google-maps
package which contains a vue component, the build process produces a resolvedSourcePath
that contains query string style arguements such as:
/home/adam/repos/vue2-map/node_modules/node_modules/.pnpm/[email protected]/node_modules/vue2-google-maps/dist/components/placeInputImpl.js?v=c006e476&vue&type=script&src=true&lang.js
This then leads to a missingSources
entry since the characters after the extension do not allow for the file to be loaded such as:
Sourcemap for "/home/adam/repos/vue2-map/node_modules/.pnpm/[email protected]/node_modules/vue2-google-maps/dist/components/placeInputImpl.js" points to missing source files
By first converting the URI to a filesystem path, we can ensure it loads the file.
Run & review this pull request in StackBlitz Codeflow.