tailwindcss 0.0.0-insiders.33dff03 → 0.0.0-insiders.35b070e

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 (66) hide show
  1. package/CHANGELOG.md +55 -7
  2. package/lib/cli-peer-dependencies.js +4 -0
  3. package/lib/cli.js +60 -53
  4. package/lib/corePlugins.js +89 -72
  5. package/lib/featureFlags.js +5 -6
  6. package/lib/index.js +1 -2
  7. package/lib/lib/cacheInvalidation.js +32 -14
  8. package/lib/lib/collapseAdjacentRules.js +1 -2
  9. package/lib/lib/defaultExtractor.js +85 -49
  10. package/lib/lib/evaluateTailwindFunctions.js +30 -14
  11. package/lib/lib/expandApplyAtRules.js +11 -26
  12. package/lib/lib/expandTailwindAtRules.js +36 -22
  13. package/lib/lib/generateRules.js +79 -45
  14. package/lib/lib/regex.js +1 -2
  15. package/lib/lib/resolveDefaultsAtRules.js +56 -45
  16. package/lib/lib/setupContextUtils.js +72 -55
  17. package/lib/lib/setupTrackingContext.js +4 -9
  18. package/lib/lib/sharedState.js +1 -2
  19. package/lib/lib/substituteScreenAtRules.js +1 -2
  20. package/lib/postcss-plugins/nesting/plugin.js +1 -2
  21. package/lib/util/buildMediaQuery.js +1 -2
  22. package/lib/util/cloneDeep.js +2 -4
  23. package/lib/util/color.js +5 -10
  24. package/lib/util/createPlugin.js +1 -2
  25. package/lib/util/createUtilityPlugin.js +1 -2
  26. package/lib/util/dataTypes.js +8 -15
  27. package/lib/util/flattenColorPalette.js +2 -5
  28. package/lib/util/formatVariantSelector.js +1 -2
  29. package/lib/util/getAllConfigs.js +10 -5
  30. package/lib/util/isValidArbitraryValue.js +1 -2
  31. package/lib/util/log.js +2 -3
  32. package/lib/util/negateValue.js +1 -2
  33. package/lib/util/normalizeConfig.js +33 -16
  34. package/lib/util/normalizeScreens.js +1 -2
  35. package/lib/util/parseAnimationValue.js +1 -2
  36. package/lib/util/pluginUtils.js +11 -3
  37. package/lib/util/removeAlphaVariables.js +18 -0
  38. package/lib/util/resolveConfig.js +57 -56
  39. package/lib/util/splitAtTopLevelOnly.js +32 -14
  40. package/lib/util/transformThemeValue.js +4 -2
  41. package/lib/util/withAlphaVariable.js +5 -5
  42. package/package.json +13 -11
  43. package/peers/index.js +2842 -845
  44. package/src/cli-peer-dependencies.js +4 -0
  45. package/src/cli.js +49 -17
  46. package/src/corePlugins.js +49 -28
  47. package/src/featureFlags.js +2 -2
  48. package/src/lib/defaultExtractor.js +43 -33
  49. package/src/lib/evaluateTailwindFunctions.js +31 -7
  50. package/src/lib/generateRules.js +39 -11
  51. package/src/lib/resolveDefaultsAtRules.js +53 -36
  52. package/src/lib/setupContextUtils.js +28 -8
  53. package/src/util/dataTypes.js +3 -5
  54. package/src/util/getAllConfigs.js +7 -0
  55. package/src/util/log.js +1 -1
  56. package/src/util/pluginUtils.js +13 -1
  57. package/src/util/removeAlphaVariables.js +24 -0
  58. package/src/util/resolveConfig.js +66 -52
  59. package/src/util/toPath.js +1 -1
  60. package/src/util/transformThemeValue.js +4 -2
  61. package/src/util/withAlphaVariable.js +1 -1
  62. package/stubs/defaultConfig.stub.js +2 -1
  63. package/stubs/simpleConfig.stub.js +1 -0
  64. package/types/config.d.ts +20 -20
  65. package/types/index.d.ts +7 -1
  66. package/types.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Fixed
11
11
 
12
+ - Provide default to `<alpha-value>` when using `theme()` ([#8652](https://github.com/tailwindlabs/tailwindcss/pull/8652))
13
+ - Detect arbitrary variants with quotes ([#8687](https://github.com/tailwindlabs/tailwindcss/pull/8687))
14
+ - Don’t add spaces around raw `/` that are preceded by numbers ([#8688](https://github.com/tailwindlabs/tailwindcss/pull/8688))
15
+
16
+ ## [3.1.3] - 2022-06-14
17
+
18
+ ### Fixed
19
+
20
+ - Fix extraction of multi-word utilities with arbitrary values and quotes ([#8604](https://github.com/tailwindlabs/tailwindcss/pull/8604))
21
+ - Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587))
22
+ - Ignore PostCSS nodes returned by `addVariant` ([#8608](https://github.com/tailwindlabs/tailwindcss/pull/8608))
23
+ - Fix missing spaces around arithmetic operators ([#8615](https://github.com/tailwindlabs/tailwindcss/pull/8615))
24
+ - Detect alpha value in CSS `theme()` function when using quotes ([#8625](https://github.com/tailwindlabs/tailwindcss/pull/8625))
25
+ - Fix "Maximum call stack size exceeded" bug ([#8636](https://github.com/tailwindlabs/tailwindcss/pull/8636))
26
+ - Allow functions returning parallel variants to mutate the container ([#8622](https://github.com/tailwindlabs/tailwindcss/pull/8622))
27
+ - Remove text opacity CSS variables from `::marker` ([#8622](https://github.com/tailwindlabs/tailwindcss/pull/8622))
28
+
29
+ ## [3.1.2] - 2022-06-10
30
+
31
+ ### Fixed
32
+
33
+ - Ensure `\` is a valid arbitrary variant token ([#8576](https://github.com/tailwindlabs/tailwindcss/pull/8576))
34
+ - Enable `postcss-import` in the CLI by default in watch mode ([#8574](https://github.com/tailwindlabs/tailwindcss/pull/8574), [#8580](https://github.com/tailwindlabs/tailwindcss/pull/8580))
35
+
36
+ ## [3.1.1] - 2022-06-09
37
+
38
+ ### Fixed
39
+
40
+ - Fix candidate extractor regression ([#8558](https://github.com/tailwindlabs/tailwindcss/pull/8558))
41
+ - Split `::backdrop` into separate defaults group ([#8567](https://github.com/tailwindlabs/tailwindcss/pull/8567))
42
+ - Fix postcss plugin type ([#8564](https://github.com/tailwindlabs/tailwindcss/pull/8564))
43
+ - Fix class detection in markdown code fences and slim templates ([#8569](https://github.com/tailwindlabs/tailwindcss/pull/8569))
44
+
45
+ ## [3.1.0] - 2022-06-08
46
+
47
+ ### Fixed
48
+
12
49
  - Types: allow for arbitrary theme values (for 3rd party plugins) ([#7926](https://github.com/tailwindlabs/tailwindcss/pull/7926))
13
50
  - Don’t split vars with numbers in them inside arbitrary values ([#8091](https://github.com/tailwindlabs/tailwindcss/pull/8091))
14
51
  - Require matching prefix when detecting negatives ([#8121](https://github.com/tailwindlabs/tailwindcss/pull/8121))
@@ -25,16 +62,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
62
  - Create tailwind.config.cjs file in ESM package when running init ([#8363](https://github.com/tailwindlabs/tailwindcss/pull/8363))
26
63
  - Fix `matchVariants` that use at-rules and placeholders ([#8392](https://github.com/tailwindlabs/tailwindcss/pull/8392))
27
64
  - Improve types of the `tailwindcss/plugin` ([#8400](https://github.com/tailwindlabs/tailwindcss/pull/8400))
65
+ - Allow returning parallel variants from `addVariant` or `matchVariant` callback functions ([#8455](https://github.com/tailwindlabs/tailwindcss/pull/8455))
66
+ - Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
67
+ - Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
68
+ - Don't inherit `to` value from parent gradients ([#8489](https://github.com/tailwindlabs/tailwindcss/pull/8489))
69
+ - Remove process dependency from log functions ([#8530](https://github.com/tailwindlabs/tailwindcss/pull/8530))
70
+ - Ensure we can use `@import 'tailwindcss/...'` without node_modules ([#8537](https://github.com/tailwindlabs/tailwindcss/pull/8537))
28
71
 
29
72
  ### Changed
30
73
 
31
- - Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
32
74
  - Only apply hover styles when supported (future) ([#8394](https://github.com/tailwindlabs/tailwindcss/pull/8394))
75
+ - Respect default ring color opacity (future) ([#8448](https://github.com/tailwindlabs/tailwindcss/pull/8448), [3f4005e](https://github.com/tailwindlabs/tailwindcss/commit/3f4005e833445f7549219eb5ae89728cbb3a2630))
33
76
 
34
77
  ### Added
35
78
 
36
- - Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
37
- - Add `rgb` and `hsl` color helpers for CSS variables ([#7665](https://github.com/tailwindlabs/tailwindcss/pull/7665))
38
79
  - Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291))
39
80
  - Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656))
40
81
  - Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800))
@@ -42,13 +83,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
42
83
  - Add new `border-spacing` utilities ([#7102](https://github.com/tailwindlabs/tailwindcss/pull/7102))
43
84
  - Add `enabled` variant ([#7905](https://github.com/tailwindlabs/tailwindcss/pull/7905))
44
85
  - Add TypeScript types for the `tailwind.config.js` file ([#7891](https://github.com/tailwindlabs/tailwindcss/pull/7891))
45
- - Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924))
86
+ - Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924), [#8526](https://github.com/tailwindlabs/tailwindcss/pull/8526))
46
87
  - Add `grid-flow-dense` utility ([#8193](https://github.com/tailwindlabs/tailwindcss/pull/8193))
47
88
  - Add `mix-blend-plus-lighter` utility ([#8288](https://github.com/tailwindlabs/tailwindcss/pull/8288))
48
89
  - Add arbitrary variants ([#8299](https://github.com/tailwindlabs/tailwindcss/pull/8299))
49
- - Add `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310))
90
+ - Add experimental `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310), [34fd0fb8](https://github.com/tailwindlabs/tailwindcss/commit/34fd0fb82aa574cddc5c7aa3ad7d1af5e3735e5d))
50
91
  - Add `prefers-contrast` media query variants ([#8410](https://github.com/tailwindlabs/tailwindcss/pull/8410))
51
- - Experimental support for variant grouping ([#8405](https://github.com/tailwindlabs/tailwindcss/pull/8405))
92
+ - Add opacity support when referencing colors with `theme` function ([#8416](https://github.com/tailwindlabs/tailwindcss/pull/8416))
93
+ - Add `postcss-import` support to the CLI ([#8437](https://github.com/tailwindlabs/tailwindcss/pull/8437))
94
+ - Add `optional` variant ([#8486](https://github.com/tailwindlabs/tailwindcss/pull/8486))
95
+ - Add `<alpha-value>` placeholder support for custom colors ([#8501](https://github.com/tailwindlabs/tailwindcss/pull/8501))
52
96
 
53
97
  ## [3.0.24] - 2022-04-12
54
98
 
@@ -1941,7 +1985,11 @@ No release notes
1941
1985
 
1942
1986
  - Everything!
1943
1987
 
1944
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...HEAD
1988
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.3...HEAD
1989
+ [3.1.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.2...v3.1.3
1990
+ [3.1.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.1...v3.1.2
1991
+ [3.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.0...v3.1.1
1992
+ [3.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...v3.1.0
1945
1993
  [3.0.24]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.23...v3.0.24
1946
1994
  [3.0.23]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.22...v3.0.23
1947
1995
  [3.0.22]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.21...v3.0.22
@@ -3,11 +3,15 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.lazyPostcss = lazyPostcss;
6
+ exports.lazyPostcssImport = lazyPostcssImport;
6
7
  exports.lazyAutoprefixer = lazyAutoprefixer;
7
8
  exports.lazyCssnano = lazyCssnano;
8
9
  function lazyPostcss() {
9
10
  return require("postcss");
10
11
  }
12
+ function lazyPostcssImport() {
13
+ return require("postcss-import");
14
+ }
11
15
  function lazyAutoprefixer() {
12
16
  return require("autoprefixer");
13
17
  }
package/lib/cli.js CHANGED
@@ -72,10 +72,8 @@ function drainStdin() {
72
72
  process.stdin.on("data", (chunk)=>{
73
73
  result += chunk;
74
74
  });
75
- process.stdin.on("end", ()=>resolve(result)
76
- );
77
- process.stdin.on("error", (err)=>reject(err)
78
- );
75
+ process.stdin.on("end", ()=>resolve(result));
76
+ process.stdin.on("error", (err)=>reject(err));
79
77
  });
80
78
  }
81
79
  function help({ message , usage , commands: commands1 , options }) {
@@ -166,10 +164,6 @@ let commands = {
166
164
  type: Boolean,
167
165
  description: `Initialize a \`${configs.postcss}\` file`
168
166
  },
169
- "--types": {
170
- type: Boolean,
171
- description: `Add TypeScript types for the \`${configs.tailwind}\` file`
172
- },
173
167
  "-f": "--full",
174
168
  "-p": "--postcss"
175
169
  }
@@ -233,16 +227,13 @@ let sharedFlags = {
233
227
  },
234
228
  "-h": "--help"
235
229
  };
236
- if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined
237
- ))) {
230
+ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
238
231
  help({
239
232
  usage: [
240
233
  "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
241
- "tailwindcss init [--full] [--postcss] [--types] [options...]",
234
+ "tailwindcss init [--full] [--postcss] [options...]",
242
235
  ],
243
- commands: Object.keys(commands).filter((command2)=>command2 !== "build"
244
- ).map((command3)=>`${command3} [options]`
245
- ),
236
+ commands: Object.keys(commands).filter((command2)=>command2 !== "build").map((command3)=>`${command3} [options]`),
246
237
  options: {
247
238
  ...commands.build.args,
248
239
  ...sharedFlags
@@ -250,8 +241,7 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
250
241
  });
251
242
  process.exit(0);
252
243
  }
253
- let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg
254
- )(process.argv[2]) || "build";
244
+ let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
255
245
  if (commands[command] === undefined) {
256
246
  if (_fs.default.existsSync(_path.default.resolve(command))) {
257
247
  // TODO: Deprecate this in future versions
@@ -263,9 +253,7 @@ if (commands[command] === undefined) {
263
253
  usage: [
264
254
  "tailwindcss <command> [options]"
265
255
  ],
266
- commands: Object.keys(commands).filter((command4)=>command4 !== "build"
267
- ).map((command5)=>`${command5} [options]`
268
- ),
256
+ commands: Object.keys(commands).filter((command4)=>command4 !== "build").map((command5)=>`${command5} [options]`),
269
257
  options: sharedFlags
270
258
  });
271
259
  process.exit(1);
@@ -284,8 +272,7 @@ let args = (()=>{
284
272
  }).map(([key, value])=>[
285
273
  key,
286
274
  typeof value === "object" ? value.type : value
287
- ]
288
- )), {
275
+ ])), {
289
276
  permissive: true
290
277
  });
291
278
  // Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
@@ -357,10 +344,6 @@ function init() {
357
344
  messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
358
345
  } else {
359
346
  let stubFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../stubs/defaultConfig.stub.js") : _path.default.resolve(__dirname, "../stubs/simpleConfig.stub.js"), "utf8");
360
- if (args["--types"]) {
361
- let typesHeading = "/** @type {import('tailwindcss/types').Config} */";
362
- stubFile = stubFile.replace(`module.exports = `, `${typesHeading}\nconst config = `) + "\nmodule.exports = config";
363
- }
364
347
  // Change colors import
365
348
  stubFile = stubFile.replace("../colors", "tailwindcss/colors");
366
349
  _fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
@@ -406,8 +389,7 @@ async function build() {
406
389
  console.error(`Specified config file ${args["--config"]} does not exist.`);
407
390
  process.exit(9);
408
391
  }
409
- let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null
410
- )(_path.default.resolve(`./${configs.tailwind}`));
392
+ let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null)(_path.default.resolve(`./${configs.tailwind}`));
411
393
  async function loadPostCssPlugins() {
412
394
  let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
413
395
  let config1 = customPostCssPath ? await (async ()=>{
@@ -446,6 +428,43 @@ async function build() {
446
428
  config1.options
447
429
  ];
448
430
  }
431
+ function loadBuiltinPostcssPlugins() {
432
+ let postcss = loadPostcss();
433
+ let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: ";
434
+ return [
435
+ [
436
+ (root)=>{
437
+ root.walkAtRules("import", (rule)=>{
438
+ if (rule.params.slice(1).startsWith("tailwindcss/")) {
439
+ rule.after(postcss.comment({
440
+ text: IMPORT_COMMENT + rule.params
441
+ }));
442
+ rule.remove();
443
+ }
444
+ });
445
+ },
446
+ (()=>{
447
+ try {
448
+ return require("postcss-import");
449
+ } catch {}
450
+ return (0, _indexJs).lazyPostcssImport();
451
+ })(),
452
+ (root)=>{
453
+ root.walkComments((rule)=>{
454
+ if (rule.text.startsWith(IMPORT_COMMENT)) {
455
+ rule.after(postcss.atRule({
456
+ name: "import",
457
+ params: rule.text.replace(IMPORT_COMMENT, "")
458
+ }));
459
+ rule.remove();
460
+ }
461
+ });
462
+ },
463
+ ],
464
+ [],
465
+ {},
466
+ ];
467
+ }
449
468
  function resolveConfig() {
450
469
  let config = configPath ? require(configPath) : {};
451
470
  if (args["--purge"]) {
@@ -478,8 +497,7 @@ async function build() {
478
497
  // like an object it's probably a raw content object. But this object
479
498
  // is not watchable, so let's remove it.
480
499
  return typeof file === "string";
481
- }).map((glob)=>(0, _normalizePath).default(glob)
482
- );
500
+ }).map((glob)=>(0, _normalizePath).default(glob));
483
501
  }
484
502
  function extractRawContent(config) {
485
503
  return config.content.files.filter((file)=>{
@@ -522,11 +540,7 @@ async function build() {
522
540
  };
523
541
  };
524
542
  tailwindPlugin.postcss = true;
525
- let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins() : [
526
- [],
527
- [],
528
- {}
529
- ];
543
+ let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins() : loadBuiltinPostcssPlugins();
530
544
  let plugins = [
531
545
  ...beforePlugins,
532
546
  tailwindPlugin,
@@ -561,13 +575,11 @@ async function build() {
561
575
  let start = process.hrtime.bigint();
562
576
  return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
563
577
  recursive: true
564
- }) : null
565
- ).then(()=>processor.process(css, {
578
+ }) : null).then(()=>processor.process(css, {
566
579
  ...postcssOptions,
567
580
  from: input,
568
581
  to: output
569
- })
570
- ).then((result)=>{
582
+ })).then((result)=>{
571
583
  if (!output) {
572
584
  return process.stdout.write(result.css);
573
585
  }
@@ -578,7 +590,7 @@ async function build() {
578
590
  }).then(()=>{
579
591
  let end = process.hrtime.bigint();
580
592
  console.error();
581
- console.error("Done in", (end - start) / BigInt(1000000) + "ms.");
593
+ console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
582
594
  });
583
595
  }
584
596
  let css1 = await (()=>{
@@ -607,8 +619,7 @@ async function build() {
607
619
  delete require.cache[require.resolve(file1)];
608
620
  }
609
621
  if (configPath) {
610
- configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
611
- );
622
+ configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file);
612
623
  for (let dependency of configDependencies){
613
624
  contextDependencies.add(dependency);
614
625
  }
@@ -616,10 +627,7 @@ async function build() {
616
627
  env.DEBUG && console.timeEnd("Module dependencies");
617
628
  return resolveConfig();
618
629
  }
619
- let [beforePlugins, afterPlugins] = includePostCss ? await loadPostCssPlugins() : [
620
- [],
621
- []
622
- ];
630
+ let [beforePlugins, afterPlugins] = includePostCss ? await loadPostCssPlugins() : loadBuiltinPostcssPlugins();
623
631
  let plugins = [
624
632
  ...beforePlugins,
625
633
  "__TAILWIND_PLUGIN_POSITION__",
@@ -683,12 +691,10 @@ async function build() {
683
691
  let start = process.hrtime.bigint();
684
692
  return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
685
693
  recursive: true
686
- }) : null
687
- ).then(()=>processor.process(css, {
694
+ }) : null).then(()=>processor.process(css, {
688
695
  from: input,
689
696
  to: output
690
- })
691
- ).then(async (result)=>{
697
+ })).then(async (result)=>{
692
698
  for (let message of result.messages){
693
699
  if (message.type === "dependency") {
694
700
  contextDependencies.add(message.file);
@@ -706,7 +712,7 @@ async function build() {
706
712
  ].filter(Boolean));
707
713
  }).then(()=>{
708
714
  let end = process.hrtime.bigint();
709
- console.error("Done in", (end - start) / BigInt(1000000) + "ms.");
715
+ console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
710
716
  }).catch((err)=>{
711
717
  if (err.name === "CssSyntaxError") {
712
718
  console.error(err.toString());
@@ -788,9 +794,10 @@ async function build() {
788
794
  });
789
795
  }
790
796
  if (shouldWatch) {
791
- /* Abort the watcher if stdin is closed to avoid zombie processes */ process.stdin.on("end", ()=>process.exit(0)
792
- );
793
- process.stdin.resume();
797
+ /* Abort the watcher if stdin is closed to avoid zombie processes */ if (process.stdin.isTTY) {
798
+ process.stdin.on("end", ()=>process.exit(0));
799
+ process.stdin.resume();
800
+ }
794
801
  startWatcher();
795
802
  } else {
796
803
  buildOnce();