You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use-case where I need to specify the URL to a generated CSS file within a Javascript options object. I therefore need the publicPath without the HTML tags.
Looks good except we should use name of the chunk instead of the positional index. Also, for the sake of consistency, lets name it get_chunks as it is a verb like render_bundle.
{% get_chunks 'editor' 'css' as 'editor_css_chunks' %} would give us a list of all CSS files in the editor chunk as a list referenced by editor_css_chunks. Then users can fetch [0], loop over it or use any custom logic.
I'd also return all information (file name, path, publicPath) as a dict instead of just the URL.
@sbaechler Just released 0.2.0 to the cheeseshop. I renamed get_chunks to get_files as chunks could get confused with webpack's chunks. A bundle contains multiple chunks and each chunks contains multiple files.
I have a use-case where I need to specify the URL to a generated CSS file within a Javascript options object. I therefore need the publicPath without the HTML tags.
I have created a working implementation here but maybe there is a better way to do it.
https://github.com/sbaechler/django-webpack-loader/blob/tag/webpack_loader/templatetags/webpack_loader.py
I am using the new tag in the CKeditor config. 'editor' is the name of the CSS bundle:
The text was updated successfully, but these errors were encountered: