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

feat: allow javascript_include_tag options to vite_client_tag #337

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

mjhoy
Copy link
Contributor

@mjhoy mjhoy commented Feb 7, 2023

Description 📖

This allows passing options such as nonce, which some browsers require if CSP is set (Firefox).

Background 📜

With CSP set in Rails, Firefox would fail to load the vite client tag without a nonce set.

The Fix 🔨

vite_client_tag now accepts an options hash that is passed to javascript_include_tag, much like vite_javascript_tag.

Co-authored-by: Wil Hall [email protected]

@mjhoy mjhoy changed the title feat: allow javascript_include_options to vite_client_tag feat: allow javascript_include_tag options to vite_client_tag Feb 7, 2023
This allows passing options such as `nonce`, which some browsers
require if CSP is set (Firefox).

Co-authored-by: Wil Hall <[email protected]>
@mjhoy mjhoy force-pushed the allow-options-to-vite-client-tag branch from 53b9573 to 2c68d0a Compare February 7, 2023 21:37
@ElMassimo
Copy link
Owner

Thanks Mikey and Wil!

@ElMassimo ElMassimo merged commit 417bcf3 into ElMassimo:main Feb 7, 2023
@mjhoy mjhoy deleted the allow-options-to-vite-client-tag branch February 7, 2023 21:47
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

Successfully merging this pull request may close these issues.

2 participants