-
Couldn't load subscription status.
- Fork 340
Added support for assets #90
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
Conversation
Assets may be accessible on the tag get_asset, therefore, anything that goes in webpack in exported-assets.js may be accessible here, by the same url linked into the js file retrieving the public_path of the file
Updated the readme with use information based on the webpack_static_path and furthermore, changed static_assets -> webpack_static_path.
|
@EmilLuta Thanks for the contributions. I really appreciate the time and work you put into this but I wish you had discussed this before investing all the time. I'm not sure about the way this PR changes the API of both django-webpack-loader and webpack-bundle-tracker. BTW, you can already get references to webpack assets using the is replaced with the full link to |
|
Hello @owais. I managed to email you a couple of times, so I thought to give it a shot at replying. Basically, what my PR adds is static files management without js. Indeed, it might've proven a good idea to have a chat before. As you stated, the changes are on both sides of the API. If you have unclarities about how this works, let me know so we can have a look together. Basically, the only thing it does is to add files in a specific bundle, allowing them to be rendered straight from django at need as static assets. Please, follow up in order to see whether there is a chance where we can get this merged into the current packages. Cheers! |
|
@owais I understand that webpack_static can be used to reverse non hashed files, but having them hashed give us useful guarantees in terms of caching (i.e. stale assets will never be used when releasing new versions). So I totally understand @EmilLuta motivations when pushing this. Basically, the lack of this is what currently impedes me from preloading resources in django templates. |
|
I've commented here on what would be the ideal API on webpack-bundle-tracker side to do this. With that change, I imagine it should be simple on django-webpack-loader side to support it. |
|
I found out that it is quite easy to use the same paths in the webpack output as Django's This means that you can just use |
|
@matthiask thank you, useful tip! |
|
@rvlb could you please check if this is necessary right now and how/if this is supported by current master? |
|
Hi folks, closing this PR for now. We've added a tutorial on our readme on how to access the assets using |
Assets may be accessible on the tag get_asset,
therefore, anything that goes in webpack in
exported-assets.js may be accessible here,
by the same url linked into the js file
retrieving the public_path of the file