Added support for module name and auto-resolution of chunk name #191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have multiple webpack entry points in my project, and depending on changes to JS or CSS code I made in any given module, I'd have to constantly change the bundle_name value. See issue #165. So, to prevent having to constantly make these changes, and to avoid breaking current functionality, I created a new template tag,
render_bundle_auto, where you can simply use the entry point name as yourbundle_nameand the plugin will search for that name within the chunk names. If the module name is in a chunk name, it will include the tag. I have tested this for my own config and it's working fine, but there are very different webpack configs out there, so that's a major caveat.Also, this code assumes that if you include a content hash in your Webpack config, that it is separated by a hyphen (seems like this is the convention?)
I'm very open to suggestions or changes.