-
Couldn't load subscription status.
- Fork 340
Handle transformed assets URL #397
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
webpack_loader/utils.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a docstring similar to the one from get_static, but clarify why this is different.
webpack_loader/loaders.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should read like this:
def get_asset_by_source_filename(self, name): files = self.get_assets()["assets"] return next((x for x in files if x.get("sourceFilename") == name), None)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, but please check suggestions. Thanks for the contribution!
7d52a83 to
889c5b4
Compare
@fjsj Thanks for the review!
Let me know if all changes fit the requirements
Adding the following template tag
```
{% webpack_asset 'path/to/original/file' %}
```
Fixes django-webpack#343
Depends on django-webpack/webpack-bundle-tracker#125
889c5b4 to
65dddf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change that after merge.
Released at 3.1.0, thanks again @batistadasilva
If you have time, could you make a PR to update the README explaining how to use webpack_asset?
You can update this section to be mostly about webpack_asset: https://github.com/django-webpack/django-webpack-loader?tab=readme-ov-file#accessing-other-webpack-assets
And only mention webpack_static briefly, as I think the use case for webpack_asset is much more common.
Adding the following template tag
Fixes #343
Depends on django-webpack/webpack-bundle-tracker#125