options.js 733 B

123456789101112131415161718192021222324252627282930313233
  1. // ------------------------------------
  2. // #POSTCSS - LOAD OPTIONS - OPTIONS
  3. // ------------------------------------
  4. 'use strict'
  5. /**
  6. *
  7. * @method options
  8. *
  9. * @param {Object} options PostCSS Config
  10. *
  11. * @return {Object} options PostCSS Options
  12. */
  13. module.exports = function options (options) {
  14. if (options.parser && typeof options.parser === 'string') {
  15. options.parser = require(options.parser)
  16. }
  17. if (options.syntax && typeof options.syntax === 'string') {
  18. options.syntax = require(options.syntax)
  19. }
  20. if (options.stringifier && typeof options.stringifier === 'string') {
  21. options.stringifier = require(options.stringifier)
  22. }
  23. if (options.plugins) {
  24. delete options.plugins
  25. }
  26. return options
  27. }