manifestPlugin.js 380 Bytes
const { WebpackManifestPlugin } = require('../compiled/webpack-manifest-plugin');

module.exports = async function addManifestPlugin(opts) {
  const { config, userConfig } = opts;
  if (userConfig.manifest) {
    config.plugin('manifest-plugin').use(WebpackManifestPlugin, [
      {
        fileName: 'asset-manifest.json',
        ...userConfig.manifest,
      },
    ]);
  }
};