"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.configManifestJsonPlugin = configManifestJsonPlugin;

var _ManifestJsonPlugin = require("../custom_plugins/ManifestJsonPlugin");

function configManifestJsonPlugin(options) {
  const {
    manifestJson
  } = options;

  if (!manifestJson.enable) {
    return null;
  }

  return new _ManifestJsonPlugin.AddFileToManifestJson([{
    outputJsonFileName: 'manifest.json',
    test: f => !/\.i18n\.js$|\.LICENSE\.txt$|\.map$/.test(f),
    needInitialEntries: true
  }, {
    outputJsonFileName: 'i18nManifest.json',
    test: f => /\.i18n\.js$/g.test(f),
    needInitialEntries: false
  }, {
    outputJsonFileName: 'licenseManifest.json',
    test: f => /\.LICENSE\.txt$/g.test(f),
    needInitialEntries: false
  }]);
}