Skip to content

Conversation

@levic
Copy link

@levic levic commented Feb 3, 2016

Currently we use django-compress to handle & cache busting. This is quite the overkill if the JS/CSS has already been processed using webpack.

The following patch allows you to change how django-webpack-loader generates output URLs -- allowing you to provide your own cache busting (or any other alteration to output URLs you might want).

This patch is intended to be a proof of concept; if you're happy with this approach then I'll implement test cases & add documentation.

@levic
Copy link
Author

levic commented Feb 3, 2016

The resolution of GET_CHUNK_URL from a string is done on-demand; it could be done when loading webpack_loader.utils but I did this to be tolerant of module loading order (if an implementation of GET_CHUNK_URL tries to import webpack_loader.utils you will get problems)

@owais
Copy link
Collaborator

owais commented Feb 21, 2016

@levic I've changed the internal implementation to a class based one. Please check it out. If you still need this, you can add a simple setting called LOADER_CLASS to settings and use that class instead of the inbuilt webpack_loader.loader.WebpackLoader class. The class already has a method named get_chunk_url which can be overridden to allow custom logic.

Thanks

@owais
Copy link
Collaborator

owais commented Feb 23, 2016

Closing this as the internal implementation has changed and this PR is not useful now. Really sorry about that. Feel free to open a new one against latest revision.

@owais owais closed this Feb 23, 2016
@levic
Copy link
Author

levic commented Feb 24, 2016

Thanks; have updated my code and will post another pull request once have tested it a bit more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants