Skip to content
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

Shouldn't we use PROCESS_ASSETS_STAGE_ADDITIONAL instead of PROCESS_ASSETS_STAGE_ADDITIONS? #600

Closed
slavafomin opened this issue Apr 5, 2021 · 2 comments

Comments

@slavafomin
Copy link
Contributor

I was looking into the code of this plugin and found some discrepancy here:

compilation.hooks.processAssets.tapAsync(
{
name: "copy-webpack-plugin",
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,
},

The plugin uses the PROCESS_ASSETS_STAGE_ADDITIONS stage when tapping into the processAssets hook. However, this stage is described as the following in the docs:

PROCESS_ASSETS_STAGE_ADDITIONS - Add additional sections to the existing assets e.g. banner or initialization code.

Considering that the plugin copies individual files or entire directories and not adds additional sections to the existing assets shouldn't we use the PROCESS_ASSETS_STAGE_ADDITIONAL stage? It looks more appropriate for this use case:

PROCESS_ASSETS_STAGE_ADDITIONAL - Add additional assets to the compilation.

@alexander-akait
Copy link
Member

Yep, you are right, we need switch on PROCESS_ASSETS_STAGE_ADDITIONAL

slavafomin added a commit to slavafomin/copy-webpack-plugin that referenced this issue Apr 5, 2021
Updated "processAssets" hook to use the proper "PROCESS_ASSETS_STAGE_ADDITIONAL" stage instead of "PROCESS_ASSETS_STAGE_ADDITIONS" one.

Signed-off-by: Slava Fomin II <slava@fomin.io>
slavafomin added a commit to slavafomin/copy-webpack-plugin that referenced this issue Apr 5, 2021
Updated "processAssets" hook to use the proper "PROCESS_ASSETS_STAGE_ADDITIONAL" stage
instead of "PROCESS_ASSETS_STAGE_ADDITIONS" one.

Signed-off-by: Slava Fomin II <slava@fomin.io>
@alexander-akait
Copy link
Member

Fixed #601

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

No branches or pull requests

2 participants