Visitar URL original
chunks passed to alter-assets event by numical · Pull Request #574 · jantimon/html-webpack-plugin · GitHub
Skip to content

chunks passed to alter-assets event - #574

Merged
jantimon merged 1 commit into
jantimon:masterfrom
numical:alter-assets-fix
Jan 29, 2017
Merged

jantimon merged 1 commit into
jantimon:masterfrom
numical:alter-assets-fix

Conversation

@numical

@numical numical commented Jan 29, 2017

Copy link
Copy Markdown
Contributor

Minor bug fix to ensure chunks param passed to alter-assets event - will also allow implementation of style-ext-html-webpack-plugin to be simplified.

@jantimon

Copy link
Copy Markdown
Owner

Can you please go a little bit in detail what your code change actually does?

@numical

numical commented Jan 29, 2017 •

Copy link
Copy Markdown
Contributor Author

Sure - it's a bug fix.
Each event is passed selected parts of html-webpack-plugin state.
So the ...before-html... events gets passed the assets, the ...after-emit... event gets passed the html etc.
The ...alter-assets... event is meant to be passed the chunks - which is quite useful. However there is a bug - the chunks value which is passed is taken from the previous event's result. The previous event is not actually passed this value so undefined is always sent.
The fix is to simply send the value generated by the ...alter-chunks... event . This, usefully, is already is scope so that is needed is to remove the incorrect assignment.

@jantimon
jantimon merged commit 2d5c42f into jantimon:master Jan 29, 2017
jantimon pushed a commit that referenced this pull request Jan 29, 2017
@jantimon

Copy link
Copy Markdown
Owner

Cool - thanks a lot. Also merged into 3.x

@numical
numical deleted the alter-assets-fix branch January 29, 2017 14:26
@lock

lock Bot commented May 31, 2018

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants