feat: add assets management#63
Merged
romsar merged 4 commits intoromsar:2.xfrom Nov 26, 2025
Merged
Conversation
Owner
|
Hey @eznix86 is it still a draft? |
Contributor
Author
|
Hi, yes I am using it in another application. i am seeing what’s missing then i will remove the draft state. |
Contributor
Author
|
My current issue is that, I need to create a singleton to generate the nonce and share it between the template and the middleware, I am open for a better way to handle it ! |
Contributor
Author
|
fixed, i've found a better way to manage csp. Let me know what you think! |
Owner
looks good, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add CSP Support (can be customized). It ensures the assets comes from you. It could be paired with a logic somewhere with a middleware. Laravel for now has a fixed nonce instead of having a different nonce per request.
Added assets preloading strategy (like laravel)
added
{{ viteAssets }}entrypoint can be set on the back or on the html.added
{{ viteAssetsWithNonce .csp_nonce }}to be able to send csp nonce to render-renderer.added
.CSPMiddleware()on vite instance.added integrity checking, there is a package for vite which write integrity for each files. The package is old, but it is just a single file and it works.
No breaking change. But it should be either
{{ vite ....}}we can call it "manual" mode, or the new one, "automatic mode". Everything is opt-in.as a note: some framework, like VueJS (tested) might include inline css. we can apply nonce with this
Basically