Skip to content

Commit

Permalink
Use new webpack API on compiler hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
s.orlova committed Apr 15, 2019
1 parent e63a89c commit bea524d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
5 changes: 2 additions & 3 deletions lib/index__6.0.0__.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ See https://www.npmjs.com/package/glob-all#notes
}

apply(compiler) {
compiler.plugin(`after-emit`, (compilation, done) =>
applyAfterEmit(compiler, compilation, this).then(done, done)
);
const afterEmit = (compilation, done) => applyAfterEmit(compiler, compilation, this).then(done, done);
compiler.hooks.afterEmit.tapAsync({ name: `UnusedFilesWebpackPlugin` }, afterEmit);
}
}

Expand Down
5 changes: 2 additions & 3 deletions lib/index__8.0.0__.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ See https://www.npmjs.com/package/glob-all#notes
}

apply(compiler) {
compiler.plugin(`after-emit`, (compilation, done) =>
applyAfterEmit(compiler, compilation, this).then(done, done)
);
const afterEmit = (compilation, done) => applyAfterEmit(compiler, compilation, this).then(done, done);
compiler.hooks.afterEmit.tapAsync({ name: `UnusedFilesWebpackPlugin` }, afterEmit);
}
}

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
"jest": {
"testPathIgnorePatterns": ["\\d+\\.\\d+\\.\\d+"]
},
"peerDependencies": {
"webpack": "^4.0.0"
},
"dependencies": {
"babel-runtime": "^7.0.0-beta.3",
"glob-all": "^3.1.0",
Expand All @@ -74,6 +77,6 @@
"prettier": "^1.11.1",
"rimraf": "^2.6.2",
"standard-version": "^4.3.0",
"webpack": "^3.8.1"
"webpack": "^4.0.0"
}
}
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ See https://www.npmjs.com/package/glob-all#notes
}

apply(compiler) {
compiler.plugin(`after-emit`, (compilation, done) =>
applyAfterEmit(compiler, compilation, this).then(done, done)
);
const afterEmit = (compilation, done) => applyAfterEmit(compiler, compilation, this).then(done, done);
compiler.hooks.afterEmit.tapAsync({ name: `UnusedFilesWebpackPlugin` }, afterEmit);
}
}

Expand Down

0 comments on commit bea524d

Please sign in to comment.