Skip to content

feat: allow javascript_include_tag options to vite_client_tag#337

Merged
ElMassimo merged 1 commit intoElMassimo:mainfrom
mjhoy:allow-options-to-vite-client-tag
Feb 7, 2023
Merged

feat: allow javascript_include_tag options to vite_client_tag#337
ElMassimo merged 1 commit intoElMassimo:mainfrom
mjhoy:allow-options-to-vite-client-tag

Conversation

@mjhoy
Copy link
Copy Markdown
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 wil@wilhall.com

@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 <wil@wilhall.com>
@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
Copy Markdown
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