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

[question] Subresource Integrity #1645

Closed
bendulum opened this issue Sep 30, 2021 · 3 comments
Closed

[question] Subresource Integrity #1645

bendulum opened this issue Sep 30, 2021 · 3 comments

Comments

@bendulum
Copy link

There is a webpack plugin webpack-subresource-integrity that can be used in combination with html-webpack-plugin.

Seems out of the scope of esbuilds responsibilities, but I'd appreciate any pointers on how to achieve this functionality in esbuild. Haven't found any existins plugins or hints. Thanks for your time.

@evanw
Copy link
Owner

evanw commented Sep 30, 2021

I haven't heard of this feature before but according to this it seems like you just need to hash the output file and put the hash in your HTML? You don't even need anything esbuild-specific to do that since you can just hash the output files on the file system, which will work with any bundler. Maybe I'm misunderstanding something.

@bendulum
Copy link
Author

bendulum commented Oct 1, 2021

Thanks for the reply!
I was looking at that plugin's source code and tried to figure out how it could be made into an esbuild plugin, especially in regards to supporting dynamic imports. I've since learned that esbuild unfortunately doesn't support that feature. Apparently supporting this is an ongoing discussion here.
I might have to wait a little longer, or give this a try and then try out what you suggested above 👍
My aim is to migrate my company's products to esbuild. I'm sure devs would love the build speeds. So thanks for this project.

@evanw
Copy link
Owner

evanw commented Oct 28, 2021

Sorry, it's not clear what you need since you don't have any specific questions (e.g. what information you need esbuild to provide). If you need to get a list of all of esbuild's output files (including dynamic imports) you can use the metafile feature: https://esbuild.github.io/api/#metafile (in case that helps).

I'm going to close this issue since this isn't a problem with esbuild.

@evanw evanw closed this as completed Oct 28, 2021
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