Skip to content

Allow to pass used hook to plugin#15

Open
DiskoPete wants to merge 1 commit intooyslin:masterfrom
DiskoPete:master
Open

Allow to pass used hook to plugin#15
DiskoPete wants to merge 1 commit intooyslin:masterfrom
DiskoPete:master

Conversation

@DiskoPete
Copy link
Copy Markdown

Hi

I run into a problem to use this plugin in conjunction with the filemanager-webpack-plugin plugin.

The problem occurred because the filemanager plugin was executed on the 'afterEmit' hook whilst replace-in-file executes on the 'done' hook.

Therefore the files were copied before the content was replaced.

To fix this I introduced a new hook property as a configuration option.
It allows to specify which compiler hook the plugin should use and defaults to 'done'.

I had to restructure the code a bit and move the callback inside the forEach loop to allow a different 'hook' value per option.

Regards
Peter

Sidenote
I removed this condition because I didn't need it for my purpose but if you think this changes makes sense to be merged, I am happy to add it back.

if (statsData.hasErrors()) {
    return
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant