configurePlugins.js 685 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. Object.defineProperty(exports, "default", {
  6. enumerable: true,
  7. get: function() {
  8. return _default;
  9. }
  10. });
  11. function _default(pluginConfig, plugins) {
  12. if (pluginConfig === undefined) {
  13. return plugins;
  14. }
  15. const pluginNames = Array.isArray(pluginConfig) ? pluginConfig : [
  16. ...new Set(plugins.filter((pluginName)=>{
  17. return pluginConfig !== false && pluginConfig[pluginName] !== false;
  18. }).concat(Object.keys(pluginConfig).filter((pluginName)=>{
  19. return pluginConfig[pluginName] !== false;
  20. })))
  21. ];
  22. return pluginNames;
  23. }