-
Notifications
You must be signed in to change notification settings - Fork 343
Inline bundle rendering #104
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
Comments
This might also be useful for including standalone chunk manifests. |
Sounds reasonable but I'll need some time to think about how to implement it and how to handle all cases (bundles stored at remote location, caching, code extension points). If anyone wants to take a stab at this, please share your proposed solution here before starting the work. |
FYI, there is a similar project python-webpack-manifest where the maintainer has already merged my PR for inline manifests (markfinger/python-webpack-manifest#5). I like the framework-agnostic approach better. Architecture wise, there is no real need to be dependent on Django to pull manifest info. |
It seems to me that the solution to this will cover a lot of the same territory as #103 (subresource integrity support). Both will require addressing the content of assets, and caching details beyond the filename. |
…for optional inline rendering
I have some code in a project of mine which works quite well. The idea is to add an additional setting, (Of course we'd probably want to add a new argument to I added the code in a gist: https://gist.github.com/matthiask/a4c301f61021614b19cd14d4e8979774 @owais Any feedback? If you like the proposal I'll happily clean it up for integration into the official repo. |
@matthiask After referring to gist link, I found a reasonable solution to this issue. |
@liuliangsir |
This requires not only support for reading files from local disk but also from remote sources as assets are often stored at remove locations in production. Anyone wants to take a shot at this, please don't forget to handle remote assets in a reliable way |
I published a good enough solution here: https://pypi.org/project/django-webpack-bundle/ It's not perfect and it especially does not support remove static assets but that's out of scope for me. |
Closing, but keeping #234 open. |
That would be great to allow rendering bundles inline rather than linking to them. This will speed up page loading for smaller bundles (e.g. having facebook/twitter sharing scripts combined into a single bundle).
For example, the following syntax:
would emit:
The text was updated successfully, but these errors were encountered: