File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,22 +32,25 @@ class MyExampleWebpackPlugin {
3232 // Define `apply` as its prototype method which is supplied with compiler as its argument
3333 apply (compiler ) {
3434 // Hook into the compilation
35- compiler .hooks .thisCompilation .tap (" MyExampleWebpackPlugin" , (compilation ) => {
36- // Specify the asset processing hook
37- compilation .hooks .processAssets .tap (
38- {
39- name: " MyExampleWebpackPlugin" ,
40- stage: compiler .webpack .Compilation .PROCESS_ASSETS_STAGE_ADDITIONS ,
41- },
42- (assets ) => {
43- console .log (" This is an example plugin!" );
44- console .log (
45- " Here’s the `compilation` object which represents a single build of assets:" ,
46- compilation
47- );
48- }
49- );
50- });
35+ compiler .hooks .thisCompilation .tap (
36+ " MyExampleWebpackPlugin" ,
37+ (compilation ) => {
38+ // Specify the asset processing hook
39+ compilation .hooks .processAssets .tap (
40+ {
41+ name: " MyExampleWebpackPlugin" ,
42+ stage: compiler .webpack .Compilation .PROCESS_ASSETS_STAGE_ADDITIONS ,
43+ },
44+ (assets ) => {
45+ console .log (" This is an example plugin!" );
46+ console .log (
47+ " Here’s the `compilation` object which represents a single build of assets:" ,
48+ compilation,
49+ );
50+ },
51+ );
52+ },
53+ );
5154 }
5255}
5356```
You can’t perform that action at this time.
0 commit comments