tailwindcss 3.1.6 → 3.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/lib/cli-peer-dependencies.js +12 -4
  3. package/lib/cli.js +78 -75
  4. package/lib/constants.js +19 -12
  5. package/lib/corePluginList.js +5 -3
  6. package/lib/corePlugins.js +194 -187
  7. package/lib/featureFlags.js +14 -7
  8. package/lib/index.js +9 -6
  9. package/lib/lib/cacheInvalidation.js +18 -15
  10. package/lib/lib/collapseAdjacentRules.js +14 -11
  11. package/lib/lib/collapseDuplicateDeclarations.js +11 -8
  12. package/lib/lib/defaultExtractor.js +38 -35
  13. package/lib/lib/detectNesting.js +4 -1
  14. package/lib/lib/evaluateTailwindFunctions.js +37 -34
  15. package/lib/lib/expandApplyAtRules.js +45 -42
  16. package/lib/lib/expandTailwindAtRules.js +153 -150
  17. package/lib/lib/generateRules.js +80 -70
  18. package/lib/lib/getModuleDependencies.js +21 -18
  19. package/lib/lib/normalizeTailwindDirectives.js +10 -7
  20. package/lib/lib/partitionApplyAtRules.js +14 -11
  21. package/lib/lib/regex.js +15 -7
  22. package/lib/lib/resolveDefaultsAtRules.js +92 -85
  23. package/lib/lib/setupContextUtils.js +109 -97
  24. package/lib/lib/setupTrackingContext.js +82 -75
  25. package/lib/lib/sharedState.js +15 -8
  26. package/lib/lib/substituteScreenAtRules.js +8 -5
  27. package/lib/postcss-plugins/nesting/index.js +7 -5
  28. package/lib/postcss-plugins/nesting/plugin.js +7 -4
  29. package/lib/processTailwindFeatures.js +34 -31
  30. package/lib/public/colors.js +6 -4
  31. package/lib/public/create-plugin.js +6 -4
  32. package/lib/public/default-config.js +7 -5
  33. package/lib/public/default-theme.js +7 -5
  34. package/lib/public/resolve-config.js +13 -10
  35. package/lib/util/bigSign.js +4 -1
  36. package/lib/util/buildMediaQuery.js +5 -2
  37. package/lib/util/cloneDeep.js +4 -1
  38. package/lib/util/cloneNodes.js +9 -2
  39. package/lib/util/color.js +11 -3
  40. package/lib/util/configurePlugins.js +4 -1
  41. package/lib/util/createPlugin.js +5 -3
  42. package/lib/util/createUtilityPlugin.js +13 -10
  43. package/lib/util/dataTypes.js +27 -19
  44. package/lib/util/defaults.js +4 -1
  45. package/lib/util/escapeClassName.js +12 -9
  46. package/lib/util/escapeCommas.js +4 -1
  47. package/lib/util/flattenColorPalette.js +5 -3
  48. package/lib/util/formatVariantSelector.js +21 -14
  49. package/lib/util/getAllConfigs.js +12 -9
  50. package/lib/util/hashConfig.js +10 -7
  51. package/lib/util/isKeyframeRule.js +4 -1
  52. package/lib/util/isPlainObject.js +4 -1
  53. package/lib/util/isValidArbitraryValue.js +33 -24
  54. package/lib/util/log.js +12 -5
  55. package/lib/util/nameClass.js +16 -8
  56. package/lib/util/negateValue.js +4 -1
  57. package/lib/util/normalizeConfig.js +26 -23
  58. package/lib/util/normalizeScreens.js +17 -2
  59. package/lib/util/parseAnimationValue.js +42 -39
  60. package/lib/util/parseBoxShadowValue.js +12 -4
  61. package/lib/util/parseDependency.js +35 -32
  62. package/lib/util/parseObjectStyles.js +14 -11
  63. package/lib/util/pluginUtils.js +28 -20
  64. package/lib/util/prefixSelector.js +6 -3
  65. package/lib/util/removeAlphaVariables.js +13 -2
  66. package/lib/util/resolveConfig.js +55 -52
  67. package/lib/util/resolveConfigPath.js +20 -17
  68. package/lib/util/responsive.js +12 -9
  69. package/lib/util/splitAtTopLevelOnly.js +16 -13
  70. package/lib/util/tap.js +4 -1
  71. package/lib/util/toColorValue.js +4 -1
  72. package/lib/util/toPath.js +18 -2
  73. package/lib/util/transformThemeValue.js +10 -7
  74. package/lib/util/validateConfig.js +5 -2
  75. package/lib/util/withAlphaVariable.js +30 -22
  76. package/package.json +8 -8
  77. package/peers/index.js +13 -4
  78. package/resolveConfig.d.ts +3 -0
  79. package/src/lib/generateRules.js +5 -1
  80. package/src/lib/setupContextUtils.js +4 -2
  81. package/src/util/cloneNodes.js +5 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ - Nothing yet!
11
+
12
+ ## [3.1.7] - 2022-07-29
13
+
14
+ ### Fixed
15
+
16
+ - Don't rewrite source maps for `@layer` rules ([#8971](https://github.com/tailwindlabs/tailwindcss/pull/8971))
17
+
18
+ ### Added
19
+
20
+ - Added types for `resolveConfig` ([#8924](https://github.com/tailwindlabs/tailwindcss/pull/8924))
21
+
22
+ ## [3.1.6] - 2022-07-11
23
+
10
24
  ### Fixed
11
25
 
12
26
  - Fix usage on Node 12.x ([b4e637e](https://github.com/tailwindlabs/tailwindcss/commit/b4e637e2e096a9d6f2210efba9541f6fd4f28e56))
@@ -1641,7 +1655,7 @@ No release notes
1641
1655
 
1642
1656
  - Make it possible to disable all core plugins using `corePlugins: false`
1643
1657
  - Make it possible to configure a single list of variants that applies to all utility plugins
1644
- - Make it possible to whitelist which core plugins should be enabled
1658
+ - Make it possible to safelist which core plugins should be enabled
1645
1659
 
1646
1660
  ### Fixed
1647
1661
 
@@ -2007,7 +2021,9 @@ No release notes
2007
2021
 
2008
2022
  - Everything!
2009
2023
 
2010
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.5...HEAD
2024
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.7...HEAD
2025
+ [3.1.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.6...v3.1.7
2026
+ [3.1.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.5...v3.1.6
2011
2027
  [3.1.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.4...v3.1.5
2012
2028
  [3.1.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.3...v3.1.4
2013
2029
  [3.1.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.2...v3.1.3
@@ -2,10 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.lazyPostcss = lazyPostcss;
6
- exports.lazyPostcssImport = lazyPostcssImport;
7
- exports.lazyAutoprefixer = lazyAutoprefixer;
8
- exports.lazyCssnano = lazyCssnano;
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ lazyPostcss: ()=>lazyPostcss,
13
+ lazyPostcssImport: ()=>lazyPostcssImport,
14
+ lazyAutoprefixer: ()=>lazyAutoprefixer,
15
+ lazyCssnano: ()=>lazyCssnano
16
+ });
9
17
  function lazyPostcss() {
10
18
  return require("postcss");
11
19
  }
package/lib/cli.js CHANGED
@@ -1,24 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var _indexJs = require("../peers/index.js");
4
- var _chokidar = _interopRequireDefault(require("chokidar"));
5
- var _path = _interopRequireDefault(require("path"));
6
- var _arg = _interopRequireDefault(require("arg"));
7
- var _fs = _interopRequireDefault(require("fs"));
8
- var _postcssLoadConfig = _interopRequireDefault(require("postcss-load-config"));
9
- var _lilconfig = require("lilconfig");
10
- var _plugins // Little bit scary, looking at private/internal API
11
- = _interopRequireDefault(require("postcss-load-config/src/plugins"));
12
- var _options // Little bit scary, looking at private/internal API
13
- = _interopRequireDefault(require("postcss-load-config/src/options"));
14
- var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
15
- var _resolveConfig = _interopRequireDefault(require("../resolveConfig"));
16
- var _fastGlob = _interopRequireDefault(require("fast-glob"));
17
- var _getModuleDependencies = _interopRequireDefault(require("./lib/getModuleDependencies"));
18
- var _log = _interopRequireDefault(require("./util/log"));
19
- var _packageJson = _interopRequireDefault(require("../package.json"));
20
- var _normalizePath = _interopRequireDefault(require("normalize-path"));
21
- var _validateConfigJs = require("./util/validateConfig.js");
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ const _indexJs = require("../peers/index.js");
7
+ const _chokidar = /*#__PURE__*/ _interopRequireDefault(require("chokidar"));
8
+ const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
9
+ const _arg = /*#__PURE__*/ _interopRequireDefault(require("arg"));
10
+ const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
11
+ const _postcssLoadConfig = /*#__PURE__*/ _interopRequireDefault(require("postcss-load-config"));
12
+ const _lilconfig = require("lilconfig");
13
+ const _plugins = /*#__PURE__*/ _interopRequireDefault(require("postcss-load-config/src/plugins" // Little bit scary, looking at private/internal API
14
+ ));
15
+ const _options = /*#__PURE__*/ _interopRequireDefault(require("postcss-load-config/src/options" // Little bit scary, looking at private/internal API
16
+ ));
17
+ const _processTailwindFeatures = /*#__PURE__*/ _interopRequireDefault(require("./processTailwindFeatures"));
18
+ const _resolveConfig = /*#__PURE__*/ _interopRequireDefault(require("../resolveConfig"));
19
+ const _fastGlob = /*#__PURE__*/ _interopRequireDefault(require("fast-glob"));
20
+ const _getModuleDependencies = /*#__PURE__*/ _interopRequireDefault(require("./lib/getModuleDependencies"));
21
+ const _log = /*#__PURE__*/ _interopRequireDefault(require("./util/log"));
22
+ const _packageJson = /*#__PURE__*/ _interopRequireDefault(require("../package.json"));
23
+ const _normalizePath = /*#__PURE__*/ _interopRequireDefault(require("normalize-path"));
24
+ const _validateConfigJs = require("./util/validateConfig.js");
22
25
  function _interopRequireDefault(obj) {
23
26
  return obj && obj.__esModule ? obj : {
24
27
  default: obj
@@ -76,7 +79,7 @@ function drainStdin() {
76
79
  process.stdin.on("error", (err)=>reject(err));
77
80
  });
78
81
  }
79
- function help({ message , usage , commands: commands1 , options }) {
82
+ function help({ message , usage , commands , options }) {
80
83
  let indent = 2;
81
84
  // Render header
82
85
  console.log();
@@ -97,11 +100,11 @@ function help({ message , usage , commands: commands1 , options }) {
97
100
  }
98
101
  }
99
102
  // Render commands
100
- if (commands1 && commands1.length > 0) {
103
+ if (commands && commands.length > 0) {
101
104
  console.log();
102
105
  console.log("Commands:");
103
- for (let command1 of commands1){
104
- console.log(" ".repeat(indent), command1);
106
+ for (let command of commands){
107
+ console.log(" ".repeat(indent), command);
105
108
  }
106
109
  }
107
110
  // Render options
@@ -121,12 +124,12 @@ function help({ message , usage , commands: commands1 , options }) {
121
124
  }
122
125
  console.log();
123
126
  console.log("Options:");
124
- for (let { flags: flags1 , description , deprecated } of Object.values(groupedOptions)){
127
+ for (let { flags , description , deprecated } of Object.values(groupedOptions)){
125
128
  if (deprecated) continue;
126
- if (flags1.length === 1) {
127
- console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags1.slice().reverse().join(", ").padEnd(20, " "), description);
129
+ if (flags.length === 1) {
130
+ console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
128
131
  } else {
129
- console.log(" ".repeat(indent), flags1.slice().reverse().join(", ").padEnd(24, " "), description);
132
+ console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description);
130
133
  }
131
134
  }
132
135
  }
@@ -150,7 +153,7 @@ function loadPostcss() {
150
153
  try {
151
154
  return require("postcss");
152
155
  } catch {}
153
- return (0, _indexJs).lazyPostcss();
156
+ return (0, _indexJs.lazyPostcss)();
154
157
  }
155
158
  let commands = {
156
159
  init: {
@@ -233,7 +236,7 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
233
236
  "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
234
237
  "tailwindcss init [--full] [--postcss] [options...]",
235
238
  ],
236
- commands: Object.keys(commands).filter((command2)=>command2 !== "build").map((command3)=>`${command3} [options]`),
239
+ commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
237
240
  options: {
238
241
  ...commands.build.args,
239
242
  ...sharedFlags
@@ -253,7 +256,7 @@ if (commands[command] === undefined) {
253
256
  usage: [
254
257
  "tailwindcss <command> [options]"
255
258
  ],
256
- commands: Object.keys(commands).filter((command4)=>command4 !== "build").map((command5)=>`${command5} [options]`),
259
+ commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
257
260
  options: sharedFlags
258
261
  });
259
262
  process.exit(1);
@@ -263,7 +266,7 @@ if (commands[command] === undefined) {
263
266
  let { args: flags , run } = commands[command];
264
267
  let args = (()=>{
265
268
  try {
266
- let result = (0, _arg).default(Object.fromEntries(Object.entries({
269
+ let result = (0, _arg.default)(Object.fromEntries(Object.entries({
267
270
  ...flags,
268
271
  ...sharedFlags
269
272
  }).filter(([_key, value])=>{
@@ -287,16 +290,16 @@ let args = (()=>{
287
290
  handler = flags[handler];
288
291
  }
289
292
  if (!handler) continue;
290
- let args1 = [];
293
+ let args = [];
291
294
  let offset = i + 1;
292
295
  // Parse args for current flag
293
296
  while(result["_"][offset] && !result["_"][offset].startsWith("-")){
294
- args1.push(result["_"][offset++]);
297
+ args.push(result["_"][offset++]);
295
298
  }
296
299
  // Cleanup manually parsed flags + args
297
- result["_"].splice(i, 1 + args1.length);
300
+ result["_"].splice(i, 1 + args.length);
298
301
  // Set the resolved value in the `result` object
299
- result[flagName] = handler.type(args1.length === 0 ? undefined : args1.length === 1 ? args1[0] : args1, flagName);
302
+ result[flagName] = handler.type(args.length === 0 ? undefined : args.length === 1 ? args[0] : args, flagName);
300
303
  }
301
304
  // Ensure that the `command` is always the first argument in the `args`.
302
305
  // This is important so that we don't have to check if a default command
@@ -354,8 +357,8 @@ function init() {
354
357
  if (_fs.default.existsSync(postcssConfigLocation)) {
355
358
  messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`);
356
359
  } else {
357
- let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, "../stubs/defaultPostCssConfig.stub.js"), "utf8");
358
- _fs.default.writeFileSync(postcssConfigLocation, stubFile, "utf8");
360
+ let stubFile1 = _fs.default.readFileSync(_path.default.resolve(__dirname, "../stubs/defaultPostCssConfig.stub.js"), "utf8");
361
+ _fs.default.writeFileSync(postcssConfigLocation, stubFile1, "utf8");
359
362
  messages.push(`Created PostCSS config file: ${_path.default.basename(postcssConfigLocation)}`);
360
363
  }
361
364
  }
@@ -392,10 +395,10 @@ async function build() {
392
395
  let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null)(_path.default.resolve(`./${configs.tailwind}`));
393
396
  async function loadPostCssPlugins() {
394
397
  let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
395
- let config1 = customPostCssPath ? await (async ()=>{
398
+ let config = customPostCssPath ? await (async ()=>{
396
399
  let file = _path.default.resolve(customPostCssPath);
397
400
  // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
398
- let { config ={} } = await (0, _lilconfig).lilconfig("postcss").load(file);
401
+ let { config ={} } = await (0, _lilconfig.lilconfig)("postcss").load(file);
399
402
  if (typeof config === "function") {
400
403
  config = config();
401
404
  } else {
@@ -406,11 +409,11 @@ async function build() {
406
409
  }
407
410
  return {
408
411
  file,
409
- plugins: (0, _plugins).default(config, file),
410
- options: (0, _options).default(config, file)
412
+ plugins: (0, _plugins.default)(config, file),
413
+ options: (0, _options.default)(config, file)
411
414
  };
412
- })() : await (0, _postcssLoadConfig).default();
413
- let configPlugins = config1.plugins;
415
+ })() : await (0, _postcssLoadConfig.default)();
416
+ let configPlugins = config.plugins;
414
417
  let configPluginTailwindIdx = configPlugins.findIndex((plugin)=>{
415
418
  if (typeof plugin === "function" && plugin.name === "tailwindcss") {
416
419
  return true;
@@ -425,7 +428,7 @@ async function build() {
425
428
  return [
426
429
  beforePlugins,
427
430
  afterPlugins,
428
- config1.options
431
+ config.options
429
432
  ];
430
433
  }
431
434
  function loadBuiltinPostcssPlugins() {
@@ -447,7 +450,7 @@ async function build() {
447
450
  try {
448
451
  return require("postcss-import");
449
452
  } catch {}
450
- return (0, _indexJs).lazyPostcssImport();
453
+ return (0, _indexJs.lazyPostcssImport)();
451
454
  })(),
452
455
  (root)=>{
453
456
  root.walkComments((rule)=>{
@@ -478,18 +481,18 @@ async function build() {
478
481
  }
479
482
  if (args["--content"]) {
480
483
  let files = args["--content"].split(/(?<!{[^}]+),/);
481
- let resolvedConfig = (0, _resolveConfig).default(config, {
484
+ let resolvedConfig = (0, _resolveConfig.default)(config, {
482
485
  content: {
483
486
  files
484
487
  }
485
488
  });
486
489
  resolvedConfig.content.files = files;
487
- resolvedConfig = (0, _validateConfigJs).validateConfig(resolvedConfig);
490
+ resolvedConfig = (0, _validateConfigJs.validateConfig)(resolvedConfig);
488
491
  return resolvedConfig;
489
492
  }
490
- let resolvedConfig = (0, _resolveConfig).default(config);
491
- resolvedConfig = (0, _validateConfigJs).validateConfig(resolvedConfig);
492
- return resolvedConfig;
493
+ let resolvedConfig1 = (0, _resolveConfig.default)(config);
494
+ resolvedConfig1 = (0, _validateConfigJs.validateConfig)(resolvedConfig1);
495
+ return resolvedConfig1;
493
496
  }
494
497
  function extractFileGlobs(config) {
495
498
  return config.content.files.filter((file)=>{
@@ -497,7 +500,7 @@ async function build() {
497
500
  // like an object it's probably a raw content object. But this object
498
501
  // is not watchable, so let's remove it.
499
502
  return typeof file === "string";
500
- }).map((glob)=>(0, _normalizePath).default(glob));
503
+ }).map((glob)=>(0, _normalizePath.default)(glob));
501
504
  }
502
505
  function extractRawContent(config) {
503
506
  return config.content.files.filter((file)=>{
@@ -531,7 +534,7 @@ async function build() {
531
534
  return {
532
535
  postcssPlugin: "tailwindcss",
533
536
  Once (root, { result }) {
534
- (0, _processTailwindFeatures).default(({ createContext })=>{
537
+ (0, _processTailwindFeatures.default)(({ createContext })=>{
535
538
  return ()=>{
536
539
  return createContext(config, changedContent);
537
540
  };
@@ -551,7 +554,7 @@ async function build() {
551
554
  try {
552
555
  return require("autoprefixer");
553
556
  } catch {}
554
- return (0, _indexJs).lazyAutoprefixer();
557
+ return (0, _indexJs.lazyAutoprefixer)();
555
558
  })(),
556
559
  args["--minify"] && (()=>{
557
560
  let options = {
@@ -566,7 +569,7 @@ async function build() {
566
569
  try {
567
570
  return require("cssnano");
568
571
  } catch {}
569
- return (0, _indexJs).lazyCssnano()(options);
572
+ return (0, _indexJs.lazyCssnano)()(options);
570
573
  })(),
571
574
  ].filter(Boolean);
572
575
  let postcss = loadPostcss();
@@ -593,7 +596,7 @@ async function build() {
593
596
  console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
594
597
  });
595
598
  }
596
- let css1 = await (()=>{
599
+ let css = await (()=>{
597
600
  // Piping in data, let's drain the stdin
598
601
  if (input === "-") {
599
602
  return drainStdin();
@@ -605,7 +608,7 @@ async function build() {
605
608
  // No input file provided, fallback to default atrules
606
609
  return "@tailwind base; @tailwind components; @tailwind utilities";
607
610
  })();
608
- return processCSS(css1);
611
+ return processCSS(css);
609
612
  }
610
613
  let context = null;
611
614
  async function startWatcher() {
@@ -615,11 +618,11 @@ async function build() {
615
618
  let watcher = null;
616
619
  function refreshConfig() {
617
620
  env.DEBUG && console.time("Module dependencies");
618
- for (let file1 of configDependencies){
619
- delete require.cache[require.resolve(file1)];
621
+ for (let file of configDependencies){
622
+ delete require.cache[require.resolve(file)];
620
623
  }
621
624
  if (configPath) {
622
- configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file);
625
+ configDependencies = (0, _getModuleDependencies.default)(configPath).map(({ file })=>file);
623
626
  for (let dependency of configDependencies){
624
627
  contextDependencies.add(dependency);
625
628
  }
@@ -638,7 +641,7 @@ async function build() {
638
641
  try {
639
642
  return require("autoprefixer");
640
643
  } catch {}
641
- return (0, _indexJs).lazyAutoprefixer();
644
+ return (0, _indexJs.lazyAutoprefixer)();
642
645
  })(),
643
646
  args["--minify"] && (()=>{
644
647
  let options = {
@@ -653,7 +656,7 @@ async function build() {
653
656
  try {
654
657
  return require("cssnano");
655
658
  } catch {}
656
- return (0, _indexJs).lazyCssnano()(options);
659
+ return (0, _indexJs.lazyCssnano)()(options);
657
660
  })(),
658
661
  ].filter(Boolean);
659
662
  async function rebuild(config) {
@@ -663,7 +666,7 @@ async function build() {
663
666
  postcssPlugin: "tailwindcss",
664
667
  Once (root, { result }) {
665
668
  env.DEBUG && console.time("Compiling CSS");
666
- (0, _processTailwindFeatures).default(({ createContext })=>{
669
+ (0, _processTailwindFeatures.default)(({ createContext })=>{
667
670
  console.error();
668
671
  console.error("Rebuilding...");
669
672
  return ()=>{
@@ -721,7 +724,7 @@ async function build() {
721
724
  }
722
725
  });
723
726
  }
724
- let css2 = await (()=>{
727
+ let css = await (()=>{
725
728
  // Piping in data, let's drain the stdin
726
729
  if (input === "-") {
727
730
  return drainStdin();
@@ -733,17 +736,17 @@ async function build() {
733
736
  // No input file provided, fallback to default atrules
734
737
  return "@tailwind base; @tailwind components; @tailwind utilities";
735
738
  })();
736
- let result1 = await processCSS(css2);
739
+ let result = await processCSS(css);
737
740
  env.DEBUG && console.timeEnd("Finished in");
738
- return result1;
741
+ return result;
739
742
  }
740
- let config2 = refreshConfig(configPath);
743
+ let config = refreshConfig(configPath);
741
744
  if (input) {
742
745
  contextDependencies.add(_path.default.resolve(input));
743
746
  }
744
747
  watcher = _chokidar.default.watch([
745
748
  ...contextDependencies,
746
- ...extractFileGlobs(config2)
749
+ ...extractFileGlobs(config)
747
750
  ], {
748
751
  usePolling: shouldPoll,
749
752
  interval: shouldPoll ? pollInterval : undefined,
@@ -758,16 +761,16 @@ async function build() {
758
761
  if (contextDependencies.has(file)) {
759
762
  env.DEBUG && console.time("Resolve config");
760
763
  context = null;
761
- config2 = refreshConfig(configPath);
764
+ config = refreshConfig(configPath);
762
765
  env.DEBUG && console.timeEnd("Resolve config");
763
766
  env.DEBUG && console.time("Watch new files");
764
- let globs = extractFileGlobs(config2);
767
+ let globs = extractFileGlobs(config);
765
768
  watcher.add(configDependencies);
766
769
  watcher.add(globs);
767
770
  env.DEBUG && console.timeEnd("Watch new files");
768
771
  chain = chain.then(async ()=>{
769
- changedContent.push(...getChangedContent(config2));
770
- await rebuild(config2);
772
+ changedContent.push(...getChangedContent(config));
773
+ await rebuild(config);
771
774
  });
772
775
  } else {
773
776
  chain = chain.then(async ()=>{
@@ -775,7 +778,7 @@ async function build() {
775
778
  content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"),
776
779
  extension: _path.default.extname(file).slice(1)
777
780
  });
778
- await rebuild(config2);
781
+ await rebuild(config);
779
782
  });
780
783
  }
781
784
  });
@@ -785,12 +788,12 @@ async function build() {
785
788
  content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"),
786
789
  extension: _path.default.extname(file).slice(1)
787
790
  });
788
- await rebuild(config2);
791
+ await rebuild(config);
789
792
  });
790
793
  });
791
794
  chain = chain.then(()=>{
792
- changedContent.push(...getChangedContent(config2));
793
- return rebuild(config2);
795
+ changedContent.push(...getChangedContent(config));
796
+ return rebuild(config);
794
797
  });
795
798
  }
796
799
  if (shouldWatch) {
package/lib/constants.js CHANGED
@@ -2,36 +2,43 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.defaultPostCssConfigStubFile = exports.simpleConfigStubFile = exports.defaultConfigStubFile = exports.supportedPostCssConfigFile = exports.supportedConfigFiles = exports.cjsPostCssConfigFile = exports.cjsConfigFile = exports.defaultPostCssConfigFile = exports.defaultConfigFile = exports.cli = void 0;
6
- var _path = _interopRequireDefault(require("path"));
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ cli: ()=>cli,
13
+ defaultConfigFile: ()=>defaultConfigFile,
14
+ defaultPostCssConfigFile: ()=>defaultPostCssConfigFile,
15
+ cjsConfigFile: ()=>cjsConfigFile,
16
+ cjsPostCssConfigFile: ()=>cjsPostCssConfigFile,
17
+ supportedConfigFiles: ()=>supportedConfigFiles,
18
+ supportedPostCssConfigFile: ()=>supportedPostCssConfigFile,
19
+ defaultConfigStubFile: ()=>defaultConfigStubFile,
20
+ simpleConfigStubFile: ()=>simpleConfigStubFile,
21
+ defaultPostCssConfigStubFile: ()=>defaultPostCssConfigStubFile
22
+ });
23
+ const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
7
24
  function _interopRequireDefault(obj) {
8
25
  return obj && obj.__esModule ? obj : {
9
26
  default: obj
10
27
  };
11
28
  }
12
29
  const cli = "tailwind";
13
- exports.cli = cli;
14
30
  const defaultConfigFile = "./tailwind.config.js";
15
- exports.defaultConfigFile = defaultConfigFile;
16
31
  const defaultPostCssConfigFile = "./postcss.config.js";
17
- exports.defaultPostCssConfigFile = defaultPostCssConfigFile;
18
32
  const cjsConfigFile = "./tailwind.config.cjs";
19
- exports.cjsConfigFile = cjsConfigFile;
20
33
  const cjsPostCssConfigFile = "./postcss.config.cjs";
21
- exports.cjsPostCssConfigFile = cjsPostCssConfigFile;
22
34
  const supportedConfigFiles = [
23
35
  cjsConfigFile,
24
36
  defaultConfigFile
25
37
  ];
26
- exports.supportedConfigFiles = supportedConfigFiles;
27
38
  const supportedPostCssConfigFile = [
28
39
  cjsPostCssConfigFile,
29
40
  defaultPostCssConfigFile
30
41
  ];
31
- exports.supportedPostCssConfigFile = supportedPostCssConfigFile;
32
42
  const defaultConfigStubFile = _path.default.resolve(__dirname, "../stubs/defaultConfig.stub.js");
33
- exports.defaultConfigStubFile = defaultConfigStubFile;
34
43
  const simpleConfigStubFile = _path.default.resolve(__dirname, "../stubs/simpleConfig.stub.js");
35
- exports.simpleConfigStubFile = simpleConfigStubFile;
36
44
  const defaultPostCssConfigStubFile = _path.default.resolve(__dirname, "../stubs/defaultPostCssConfig.stub.js");
37
- exports.defaultPostCssConfigStubFile = defaultPostCssConfigStubFile;
@@ -2,8 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.default = void 0;
6
- var _default = [
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: ()=>_default
8
+ });
9
+ const _default = [
7
10
  "preflight",
8
11
  "container",
9
12
  "accessibility",
@@ -176,4 +179,3 @@ var _default = [
176
179
  "willChange",
177
180
  "content"
178
181
  ];
179
- exports.default = _default;