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

CSS sourcemap generation causing issue with JS sourcemap generation #5

Closed
kp-entrust opened this issue Aug 15, 2022 · 2 comments
Closed

Comments

@kp-entrust
Copy link

Description
Vite currently supports CSS sourcemap only on dev, not on build. It also supports JS sourcemap on both environments. When this plugin is installed in a Vite codebase, the build process is unable generate the CSS sourcemap. This issue also causes the JS sourcemap from being generated fully.

Error
"Sourcemap is likely to be incorrect: a plugin (inline-css-modules) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help"

Versions:
vite 3.0.0
vite-plugin-inline-css-modules 0.0.6

Steps to reproduce:

  1. Start with a fresh vite create vite@latest app --template react-ts
  2. Make sure build.sourcemap is set to true in vite.config.js
  3. npm run build
  4. Notice the built files in dist has a working JS sourcemap
  5. npm i vite-plugin-inline-css-modules
  6. import { inlineCssModules } from vite-plugin-inline-css-modulesand call it in theplugins[]invite.config.js`
  7. npm run build
  8. Notice the built files in dist has a broken JS sourcemap (with much lower file size compared to previous)
@bluskript
Copy link
Owner

hey @kp-entrust ! Can you try with vite-plugin-inline-css-modules@0.0.7? I disabled sourcemap generation and it seemed to get rid of the warnings and sourcemaps still seem to be working as expected.

@kp-entrust
Copy link
Author

That seems to have worked. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants