validateConfig.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. Object.defineProperty(exports, "validateConfig", {
  6. enumerable: true,
  7. get: function() {
  8. return validateConfig;
  9. }
  10. });
  11. const _log = /*#__PURE__*/ _interop_require_default(require("./log"));
  12. function _interop_require_default(obj) {
  13. return obj && obj.__esModule ? obj : {
  14. default: obj
  15. };
  16. }
  17. function validateConfig(config) {
  18. if (config.content.files.length === 0) {
  19. _log.default.warn("content-problems", [
  20. "The `content` option in your Tailwind CSS configuration is missing or empty.",
  21. "Configure your content sources or your generated CSS will be missing styles.",
  22. "https://tailwindcss.com/docs/content-configuration"
  23. ]);
  24. }
  25. // Warn if the line-clamp plugin is installed
  26. try {
  27. let plugin = require("@tailwindcss/line-clamp");
  28. if (config.plugins.includes(plugin)) {
  29. _log.default.warn("line-clamp-in-core", [
  30. "As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.",
  31. "Remove it from the `plugins` array in your configuration to eliminate this warning."
  32. ]);
  33. config.plugins = config.plugins.filter((p)=>p !== plugin);
  34. }
  35. } catch {}
  36. return config;
  37. }