deps.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // @ts-check
  2. "use strict";
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. function _export(target, all) {
  7. for(var name in all)Object.defineProperty(target, name, {
  8. enumerable: true,
  9. get: all[name]
  10. });
  11. }
  12. _export(exports, {
  13. loadPostcss: function() {
  14. return loadPostcss;
  15. },
  16. loadPostcssImport: function() {
  17. return loadPostcssImport;
  18. },
  19. loadCssNano: function() {
  20. return loadCssNano;
  21. },
  22. loadAutoprefixer: function() {
  23. return loadAutoprefixer;
  24. }
  25. });
  26. const _index = require("../../../peers/index.js");
  27. function loadPostcss() {
  28. // Try to load a local `postcss` version first
  29. try {
  30. return require("postcss");
  31. } catch {}
  32. return (0, _index.lazyPostcss)();
  33. }
  34. function loadPostcssImport() {
  35. // Try to load a local `postcss-import` version first
  36. try {
  37. return require("postcss-import");
  38. } catch {}
  39. return (0, _index.lazyPostcssImport)();
  40. }
  41. function loadCssNano() {
  42. let options = {
  43. preset: [
  44. "default",
  45. {
  46. cssDeclarationSorter: false
  47. }
  48. ]
  49. };
  50. // Try to load a local `cssnano` version first
  51. try {
  52. return require("cssnano");
  53. } catch {}
  54. return (0, _index.lazyCssnano)()(options);
  55. }
  56. function loadAutoprefixer() {
  57. // Try to load a local `autoprefixer` version first
  58. try {
  59. return require("autoprefixer");
  60. } catch {}
  61. return (0, _index.lazyAutoprefixer)();
  62. }