"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.pluginName = exports.default = void 0;

var _I18nKeysIdentifer = _interopRequireDefault(require("./I18nKeysIdentifer"));

var _optionsHandler = require("./optionsHandler");

var _I18nFilesEmitPlugin = require("./I18nFilesEmitPlugin");

var _I18nRuntimeDealerPlugin = require("./I18nRuntimeDealerPlugin");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// import getI18nKeysFormModules from './utils/getI18nKeysFormModules';
const pluginName = 'mini-i18n-extract-plugin';
exports.pluginName = pluginName;
const pluginSymbol = Symbol(pluginName);

class I18nExtractPlugin {
  constructor(options = {}) {
    // initialize options
    this.options = (0, _optionsHandler.optionsHandler)(options);
  }

  apply(compiler) {
    new _I18nKeysIdentifer.default(this.options).apply(compiler);
    new _I18nFilesEmitPlugin.I18nFilesEmitPlugin(this.options).apply(compiler);
    new _I18nRuntimeDealerPlugin.I18nRuntimeDealerPlugin(this.options).apply(compiler);
  }

}

exports.default = I18nExtractPlugin;
I18nExtractPlugin.pluginName = pluginName;
I18nExtractPlugin.pluginSymbol = pluginSymbol;