UNPKG

webpack-config

Version:

Helps to load, extend and merge webpack configs

54 lines (43 loc) 1.09 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _weakMap = require('babel-runtime/core-js/weak-map'); var _weakMap2 = _interopRequireDefault(_weakMap); var _ConfigCommandTypes = require('./ConfigCommandTypes'); var _ConfigCommandTypes2 = _interopRequireDefault(_ConfigCommandTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @private * @type {WeakMap} */ const CONTAINER = new _weakMap2.default(); /** * @class */ class ConfigCommandFactory { /** * @constructor * @param {ConfigContainer} container */ constructor(container) { CONTAINER.set(this, container); } /** * @readonly * @type {ConfigContainer} */ get container() { return CONTAINER.get(this); } /** * Creates {@link ConfigCommand} * @param {String} name * @returns {ConfigCommand} */ createCommand(name) { return this.container.resolve(_ConfigCommandTypes2.default[name]); } } exports.default = ConfigCommandFactory; //# sourceMappingURL=ConfigCommandFactory.js.map