apply(compiler) {
    this.compiler = compiler;
    // check if webpack 4 `hooks` exists
    // otherwise, will fallback to the old syntax
    // @See {@Link https://webpack.js.org/api/compiler-hooks/}
    if (compiler.hooks) {
      compiler.hooks.emit.tapAsync(PLUGIN_NAME, this.handleEmit.bind(this));
    } else {
      compiler.plugin('emit', this.handleEmit.bind(this));
    }
  }
/**
   * Webpack apply method.
   * @method apply
   * @param {object} compiler - Webpack compiler object
   * It represents the fully configured Webpack environment.
   * @See {@link https://github.com/webpack/docs/wiki/how-to-write-a-plugin#compiler-and-compilation}
   */
Webpack apply method.
@method apply
@param {object} compiler - Webpack compiler object
It represents the fully configured Webpack environment.
Webpack apply method . @method apply @param { object } compiler - Webpack compiler object It represents the fully configured Webpack environment .
apply(compiler) {
    this.compiler = compiler;
    if (compiler.hooks) {
      compiler.hooks.emit.tapAsync(PLUGIN_NAME, this.handleEmit.bind(this));
    } else {
      compiler.plugin('emit', this.handleEmit.bind(this));
    }
  }
apply ( compiler ) { this . compiler = compiler ; if ( compiler . hooks ) { compiler . hooks . emit . tapAsync ( PLUGIN_NAME , this . handleEmit . bind ( this ) ) ; } else { compiler . plugin ( 'emit' , this . handleEmit . bind ( this ) ) ; } }
Webpack apply method.
Webpack apply method .
// check if webpack 4 `hooks` exists // otherwise, will fallback to the old syntax // @See {@Link https://webpack.js.org/api/compiler-hooks/}