apply(compiler) {
    this.compiler = compiler

    const version = 'jsonpFunction' in compiler.options.output ? 4 : 5

    // Add a custom chunk loading callback
    if (version === 4) {
      compiler.options.output.jsonpFunction = this.opts.chunkLoadingGlobal
    } else {
      compiler.options.output.chunkLoadingGlobal = this.opts.chunkLoadingGlobal
    }

    if (this.opts.outputAsset || this.opts.writeToDisk) {
      if (version === 4) {
        // webpack 4
        compiler.hooks.emit.tap(name, compilation => {
          const asset = this.handleEmit(compilation)
          if (asset) {
            compilation.assets[this.opts.filename] = asset
          }
        })
      } else {
        // webpack 5
        compiler.hooks.make.tap(name, compilation => {
          compilation.hooks.processAssets.tap(
            {
              name,
              stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT,
            },
            () => {
              const asset = this.handleEmit(compilation)
              if (asset) {
                compilation.emitAsset(this.opts.filename, asset)
              }
            },
          )
        })
      }
    }
  }
Write Assets Manifest file
@method writeAssetsFile