vite icon indicating copy to clipboard operation
vite copied to clipboard

fix(sourcemap): improve sourcemap compatibility for vue2

Open amweiss opened this issue 9 months ago • 1 comments

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.

amweiss avatar May 04 '24 00:05 amweiss

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

stackblitz[bot] avatar May 04 '24 00:05 stackblitz[bot]