Use webpack-4 style hooks.
This commit is contained in:
parent
f754feae72
commit
e9060a1ab1
3 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ export default class AutoIncreaseVersion {
|
|||
// we have to register AutoIncreaseVersion instead of firing it straight away
|
||||
if (config.componentsOptions.AutoIncreaseVersion.runInWatchMode) {
|
||||
if (this.context.compiler) {
|
||||
this.context.compiler.plugin('emit', (compilation, cb) => {
|
||||
this.context.compiler.hooks.emit.tap((compilation, cb) => {
|
||||
this.start();
|
||||
cb();
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ export default class InjectAsComment {
|
|||
*/
|
||||
apply() {
|
||||
// bind into emit hook
|
||||
this.context.compiler.plugin('emit', (compilation, cb) => {
|
||||
this.context.compiler.hooks.emit.tap((compilation, cb) => {
|
||||
// iterate over all assets file in compilation
|
||||
for (const basename in compilation.assets) {
|
||||
// bug fix, extname is not able to handle chunk file params index.js?random123
|
||||
|
|
|
@ -21,7 +21,7 @@ export default class InjectByTag {
|
|||
* @return {Promise}
|
||||
*/
|
||||
apply() {
|
||||
this.context.compiler.plugin('emit', (compilation, cb) => {
|
||||
this.context.compiler.hooks.emit.tap((compilation, cb) => {
|
||||
// for every output file
|
||||
for (const basename in compilation.assets) {
|
||||
// only if match regex
|
||||
|
|
Loading…
Reference in a new issue