-
Notifications
You must be signed in to change notification settings - Fork 282
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
Vite: Sourcemap warning suppression #699
Comments
The rollup plugin generates a similar warning https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect |
I'm not sure creating sourcemaps for VE files is possible, as the transform that occurs is not an AST transform. I agree this warning is not ideal though. Not sure what the recommended approach is here. Is there a way to tell Vite/Rollup that this transform won't create a sourcemap and to not warn about it? Or am I wrong about sourcemaps being a viable option? |
I think it may be difficult to create exact sourcemaps, but it might be possible to at least provide a mapping to the relevant |
@graup Do you have any ideas on how to implement it? |
For now, it should be possible to suppress the warnings by returning empty source maps. Haven't tested it but I think in the transform functions we just need to change return processVanillaFile(...) to return {
code: await processVanillaFile(...),
map: { mappings: '' }
} I'll have a think about if we can return more meaningful maps there. |
Describe the bug
When building an app using vite and vanilla extract, and when the build.sourcemap vite config option is set to true, I receive a bunch of sourcemap warnings.
i.e.
The vanilla extract docs list a way to supress this warning for esbuild:
https://github.com/seek-oss/vanilla-extract#esbuild
but I haven't found a way to suppress them for Vite. Would love to be able to suppress these if possible.
Link to reproduction
System Info
Output of
npx envinfo --system --npmPackages @vanilla-extract/css,@vanilla-extract/webpack-plugin,@vanilla-extract/esbuild-plugin,@vanilla-extract/vite-plugin,@vanilla-extract/sprinkles,webpack,esbuild,vite --binaries --browsers
:The text was updated successfully, but these errors were encountered: