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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production build contains sourcemaps when they are turned off #49

Closed
2 tasks done
smalluban opened this issue Mar 24, 2021 · 4 comments
Closed
2 tasks done

Production build contains sourcemaps when they are turned off #49

smalluban opened this issue Mar 24, 2021 · 4 comments
Labels
bug: pending triage Something doesn't seem to be working, but hasn't been verified

Comments

@smalluban
Copy link

smalluban commented Mar 24, 2021

  • I have tried upgrading by running bundle update vite_ruby.
  • I have read the troubleshooting section before opening an issue.

Description 馃摉

bundle exec vite build generates source maps, where vite as default has them turned off. Even setting build.sourcmap to false explicitly does not work. As the result, source maps are pushed to the production environment.

@smalluban smalluban added the bug: pending triage Something doesn't seem to be working, but hasn't been verified label Mar 24, 2021
@ElMassimo
Copy link
Owner

Hi Dominik. Thanks for the report!

I want the default to be consistent with what Rails does, but not being able to disable them explicitly is a bug.

I'll make a fix to ensure that passing sourcemap: false works as expected.

@smalluban
Copy link
Author

smalluban commented Mar 24, 2021

I read the linked thread comment, and as I understand the way they go, I think your project should follow defaults from the vite project, as it is just a wrapper on top of the Vite. Within the fix you mentioned, it still will be weird, that feature that should be turned off by default, is not.

Also, in your documentation, you can read:

You can customize this file as needed, check Vite's plugins and config reference for more info.

The only way you can understand that sentence is that whatever vite has in the config, it will work as the vite works.

However, you may change the files, when they are generated by the project, so the configuration will have build: { sourcemap: true } explicitly written in vite.config.ts file.

@ElMassimo
Copy link
Owner

ElMassimo commented Mar 24, 2021

Released vite-plugin-ruby@1.0.18, which allows disabling source maps in production by using build: { sourcemap: false }.

The default remains unchanged, as the advantages of generating source maps outweigh the disadvantages in most scenarios, it has better alignment with the Rails ecosystem, and it can be easily turned off now that the bug is fixed.

I added a note in the docs explaining the decision.

@smalluban
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Something doesn't seem to be working, but hasn't been verified
Projects
None yet
Development

No branches or pull requests

2 participants