tailwindcss 0.0.0-insiders.d2b53cd → 0.0.0-insiders.d2fdf9e

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 (143) hide show
  1. package/CHANGELOG.md +364 -2
  2. package/LICENSE +1 -2
  3. package/README.md +8 -4
  4. package/colors.d.ts +3 -0
  5. package/colors.js +2 -1
  6. package/defaultConfig.d.ts +3 -0
  7. package/defaultConfig.js +2 -1
  8. package/defaultTheme.d.ts +3 -0
  9. package/defaultTheme.js +2 -1
  10. package/lib/cli-peer-dependencies.js +10 -5
  11. package/lib/cli.js +306 -203
  12. package/lib/constants.js +9 -9
  13. package/lib/corePluginList.js +10 -1
  14. package/lib/corePlugins.js +1835 -1760
  15. package/lib/css/preflight.css +19 -13
  16. package/lib/featureFlags.js +18 -15
  17. package/lib/index.js +17 -8
  18. package/lib/lib/cacheInvalidation.js +69 -0
  19. package/lib/lib/collapseAdjacentRules.js +30 -14
  20. package/lib/lib/collapseDuplicateDeclarations.js +80 -0
  21. package/lib/lib/defaultExtractor.js +187 -0
  22. package/lib/lib/detectNesting.js +17 -2
  23. package/lib/lib/evaluateTailwindFunctions.js +40 -24
  24. package/lib/lib/expandApplyAtRules.js +414 -157
  25. package/lib/lib/expandTailwindAtRules.js +145 -126
  26. package/lib/lib/generateRules.js +403 -103
  27. package/lib/lib/getModuleDependencies.js +14 -14
  28. package/lib/lib/normalizeTailwindDirectives.js +43 -35
  29. package/lib/lib/partitionApplyAtRules.js +53 -0
  30. package/lib/lib/regex.js +53 -0
  31. package/lib/lib/resolveDefaultsAtRules.js +83 -65
  32. package/lib/lib/setupContextUtils.js +315 -204
  33. package/lib/lib/setupTrackingContext.js +60 -56
  34. package/lib/lib/sharedState.js +38 -5
  35. package/lib/lib/substituteScreenAtRules.js +9 -6
  36. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  37. package/lib/postcss-plugins/nesting/index.js +17 -0
  38. package/lib/postcss-plugins/nesting/plugin.js +85 -0
  39. package/lib/processTailwindFeatures.js +19 -9
  40. package/lib/public/colors.js +241 -241
  41. package/lib/public/resolve-config.js +5 -5
  42. package/lib/util/buildMediaQuery.js +13 -24
  43. package/lib/util/cloneDeep.js +1 -1
  44. package/lib/util/cloneNodes.js +12 -1
  45. package/lib/util/color.js +43 -32
  46. package/lib/util/createPlugin.js +1 -2
  47. package/lib/util/createUtilityPlugin.js +11 -15
  48. package/lib/util/dataTypes.js +114 -74
  49. package/lib/util/defaults.js +6 -0
  50. package/lib/util/escapeClassName.js +5 -5
  51. package/lib/util/escapeCommas.js +1 -1
  52. package/lib/util/flattenColorPalette.js +2 -4
  53. package/lib/util/formatVariantSelector.js +194 -0
  54. package/lib/util/getAllConfigs.js +13 -5
  55. package/lib/util/hashConfig.js +5 -5
  56. package/lib/util/isKeyframeRule.js +1 -1
  57. package/lib/util/isPlainObject.js +1 -1
  58. package/lib/util/isValidArbitraryValue.js +64 -0
  59. package/lib/util/log.js +11 -7
  60. package/lib/util/nameClass.js +7 -6
  61. package/lib/util/negateValue.js +4 -4
  62. package/lib/util/normalizeConfig.js +84 -45
  63. package/lib/util/normalizeScreens.js +59 -0
  64. package/lib/util/parseAnimationValue.js +56 -56
  65. package/lib/util/parseBoxShadowValue.js +76 -0
  66. package/lib/util/parseDependency.js +32 -32
  67. package/lib/util/parseObjectStyles.js +6 -6
  68. package/lib/util/pluginUtils.js +34 -165
  69. package/lib/util/prefixSelector.js +4 -7
  70. package/lib/util/resolveConfig.js +115 -66
  71. package/lib/util/resolveConfigPath.js +17 -18
  72. package/lib/util/responsive.js +6 -6
  73. package/lib/util/splitAtTopLevelOnly.js +72 -0
  74. package/lib/util/toColorValue.js +1 -2
  75. package/lib/util/toPath.js +6 -1
  76. package/lib/util/transformThemeValue.js +42 -34
  77. package/lib/util/validateConfig.js +21 -0
  78. package/lib/util/withAlphaVariable.js +19 -19
  79. package/nesting/index.js +2 -12
  80. package/package.json +39 -40
  81. package/peers/index.js +11511 -10819
  82. package/plugin.d.ts +11 -0
  83. package/plugin.js +2 -1
  84. package/resolveConfig.js +2 -1
  85. package/scripts/generate-types.js +52 -0
  86. package/src/cli-peer-dependencies.js +7 -1
  87. package/src/cli.js +164 -30
  88. package/src/corePluginList.js +1 -1
  89. package/src/corePlugins.js +540 -535
  90. package/src/css/preflight.css +19 -13
  91. package/src/featureFlags.js +5 -5
  92. package/src/index.js +14 -6
  93. package/src/lib/cacheInvalidation.js +52 -0
  94. package/src/lib/collapseAdjacentRules.js +21 -2
  95. package/src/lib/collapseDuplicateDeclarations.js +93 -0
  96. package/src/lib/defaultExtractor.js +192 -0
  97. package/src/lib/detectNesting.js +22 -3
  98. package/src/lib/evaluateTailwindFunctions.js +24 -7
  99. package/src/lib/expandApplyAtRules.js +442 -154
  100. package/src/lib/expandTailwindAtRules.js +79 -37
  101. package/src/lib/generateRules.js +400 -83
  102. package/src/lib/normalizeTailwindDirectives.js +7 -1
  103. package/src/lib/partitionApplyAtRules.js +52 -0
  104. package/src/lib/regex.js +74 -0
  105. package/src/lib/resolveDefaultsAtRules.js +35 -10
  106. package/src/lib/setupContextUtils.js +273 -112
  107. package/src/lib/setupTrackingContext.js +12 -7
  108. package/src/lib/sharedState.js +42 -4
  109. package/src/lib/substituteScreenAtRules.js +6 -3
  110. package/src/postcss-plugins/nesting/README.md +42 -0
  111. package/src/postcss-plugins/nesting/index.js +13 -0
  112. package/src/postcss-plugins/nesting/plugin.js +80 -0
  113. package/src/processTailwindFeatures.js +14 -2
  114. package/src/util/buildMediaQuery.js +14 -18
  115. package/src/util/cloneNodes.js +14 -1
  116. package/src/util/color.js +31 -14
  117. package/src/util/dataTypes.js +56 -16
  118. package/src/util/defaults.js +6 -0
  119. package/src/util/formatVariantSelector.js +213 -0
  120. package/src/util/getAllConfigs.js +7 -0
  121. package/src/util/isValidArbitraryValue.js +61 -0
  122. package/src/util/log.js +10 -6
  123. package/src/util/nameClass.js +1 -1
  124. package/src/util/normalizeConfig.js +32 -3
  125. package/src/util/normalizeScreens.js +45 -0
  126. package/src/util/parseBoxShadowValue.js +72 -0
  127. package/src/util/pluginUtils.js +15 -138
  128. package/src/util/prefixSelector.js +7 -8
  129. package/src/util/resolveConfig.js +97 -15
  130. package/src/util/splitAtTopLevelOnly.js +71 -0
  131. package/src/util/toPath.js +23 -1
  132. package/src/util/transformThemeValue.js +24 -7
  133. package/src/util/validateConfig.js +13 -0
  134. package/stubs/defaultConfig.stub.js +47 -17
  135. package/types/config.d.ts +325 -0
  136. package/types/generated/.gitkeep +0 -0
  137. package/types/generated/colors.d.ts +276 -0
  138. package/types/generated/corePluginList.d.ts +1 -0
  139. package/types/index.d.ts +1 -0
  140. package/types.d.ts +1 -0
  141. package/lib/lib/setupWatchingContext.js +0 -284
  142. package/nesting/plugin.js +0 -41
  143. package/src/lib/setupWatchingContext.js +0 -304
package/lib/cli.js CHANGED
@@ -6,9 +6,11 @@ var _path = _interopRequireDefault(require("path"));
6
6
  var _arg = _interopRequireDefault(require("arg"));
7
7
  var _fs = _interopRequireDefault(require("fs"));
8
8
  var _postcssLoadConfig = _interopRequireDefault(require("postcss-load-config"));
9
- var _cosmiconfig = require("cosmiconfig");
9
+ var _lilconfig = require("lilconfig");
10
10
  var _plugins // Little bit scary, looking at private/internal API
11
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"));
12
14
  var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
13
15
  var _resolveConfig = _interopRequireDefault(require("../resolveConfig"));
14
16
  var _fastGlob = _interopRequireDefault(require("fast-glob"));
@@ -16,31 +18,67 @@ var _getModuleDependencies = _interopRequireDefault(require("./lib/getModuleDepe
16
18
  var _log = _interopRequireDefault(require("./util/log"));
17
19
  var _packageJson = _interopRequireDefault(require("../package.json"));
18
20
  var _normalizePath = _interopRequireDefault(require("normalize-path"));
21
+ var _validateConfigJs = require("./util/validateConfig.js");
19
22
  function _interopRequireDefault(obj) {
20
23
  return obj && obj.__esModule ? obj : {
21
24
  default: obj
22
25
  };
23
26
  }
24
27
  let env = {
25
- DEBUG: process.env.DEBUG !== undefined
28
+ DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== "0"
29
+ };
30
+ function isESM() {
31
+ const pkgPath = _path.default.resolve("./package.json");
32
+ try {
33
+ let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
34
+ return pkg.type && pkg.type === "module";
35
+ } catch (err) {
36
+ return false;
37
+ }
38
+ }
39
+ let configs = isESM() ? {
40
+ tailwind: "tailwind.config.cjs",
41
+ postcss: "postcss.config.cjs"
42
+ } : {
43
+ tailwind: "tailwind.config.js",
44
+ postcss: "postcss.config.js"
26
45
  };
27
46
  // ---
28
47
  function indentRecursive(node, indent = 0) {
29
48
  node.each && node.each((child, i)=>{
30
- if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes('\n')) {
31
- child.raws.before = `\n${node.type !== 'rule' && i > 0 ? '\n' : ''}${' '.repeat(indent)}`;
49
+ if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes("\n")) {
50
+ child.raws.before = `\n${node.type !== "rule" && i > 0 ? "\n" : ""}${" ".repeat(indent)}`;
32
51
  }
33
- child.raws.after = `\n${' '.repeat(indent)}`;
52
+ child.raws.after = `\n${" ".repeat(indent)}`;
34
53
  indentRecursive(child, indent + 1);
35
54
  });
36
55
  }
37
56
  function formatNodes(root) {
38
57
  indentRecursive(root);
39
58
  if (root.first) {
40
- root.first.raws.before = '';
59
+ root.first.raws.before = "";
41
60
  }
42
61
  }
43
- function help({ message , usage , commands , options }) {
62
+ async function outputFile(file, contents) {
63
+ if (_fs.default.existsSync(file) && await _fs.default.promises.readFile(file, "utf8") === contents) {
64
+ return; // Skip writing the file
65
+ }
66
+ // Write the file
67
+ await _fs.default.promises.writeFile(file, contents, "utf8");
68
+ }
69
+ function drainStdin() {
70
+ return new Promise((resolve, reject)=>{
71
+ let result = "";
72
+ process.stdin.on("data", (chunk)=>{
73
+ result += chunk;
74
+ });
75
+ process.stdin.on("end", ()=>resolve(result)
76
+ );
77
+ process.stdin.on("error", (err)=>reject(err)
78
+ );
79
+ });
80
+ }
81
+ function help({ message , usage , commands: commands1 , options }) {
44
82
  let indent = 2;
45
83
  // Render header
46
84
  console.log();
@@ -48,32 +86,31 @@ function help({ message , usage , commands , options }) {
48
86
  // Render message
49
87
  if (message) {
50
88
  console.log();
51
- for (let msg of message.split('\n')){
89
+ for (let msg of message.split("\n")){
52
90
  console.log(msg);
53
91
  }
54
92
  }
55
93
  // Render usage
56
94
  if (usage && usage.length > 0) {
57
95
  console.log();
58
- console.log('Usage:');
96
+ console.log("Usage:");
59
97
  for (let example of usage){
60
- console.log(' '.repeat(indent), example);
98
+ console.log(" ".repeat(indent), example);
61
99
  }
62
100
  }
63
101
  // Render commands
64
- if (commands && commands.length > 0) {
102
+ if (commands1 && commands1.length > 0) {
65
103
  console.log();
66
- console.log('Commands:');
67
- for (let command of commands){
68
- console.log(' '.repeat(indent), command);
104
+ console.log("Commands:");
105
+ for (let command1 of commands1){
106
+ console.log(" ".repeat(indent), command1);
69
107
  }
70
108
  }
71
109
  // Render options
72
110
  if (options) {
73
- let groupedOptions = {
74
- };
111
+ let groupedOptions = {};
75
112
  for (let [key, value] of Object.entries(options)){
76
- if (typeof value === 'object') {
113
+ if (typeof value === "object") {
77
114
  groupedOptions[key] = {
78
115
  ...value,
79
116
  flags: [
@@ -85,13 +122,13 @@ function help({ message , usage , commands , options }) {
85
122
  }
86
123
  }
87
124
  console.log();
88
- console.log('Options:');
89
- for (let { flags , description , deprecated } of Object.values(groupedOptions)){
125
+ console.log("Options:");
126
+ for (let { flags: flags1 , description , deprecated } of Object.values(groupedOptions)){
90
127
  if (deprecated) continue;
91
- if (flags.length === 1) {
92
- console.log(' '.repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(', ').padEnd(20, ' '), description);
128
+ if (flags1.length === 1) {
129
+ console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags1.slice().reverse().join(", ").padEnd(20, " "), description);
93
130
  } else {
94
- console.log(' '.repeat(indent), flags.slice().reverse().join(', ').padEnd(24, ' '), description);
131
+ console.log(" ".repeat(indent), flags1.slice().reverse().join(", ").padEnd(24, " "), description);
95
132
  }
96
133
  }
97
134
  }
@@ -105,90 +142,106 @@ function oneOf(...options) {
105
142
  return parsed;
106
143
  }
107
144
  }
108
- throw new Error('...');
145
+ throw new Error("...");
109
146
  }, {
110
147
  manualParsing: true
111
148
  });
112
149
  }
150
+ function loadPostcss() {
151
+ // Try to load a local `postcss` version first
152
+ try {
153
+ return require("postcss");
154
+ } catch {}
155
+ return (0, _indexJs).lazyPostcss();
156
+ }
113
157
  let commands = {
114
158
  init: {
115
159
  run: init,
116
160
  args: {
117
- '--full': {
161
+ "--full": {
162
+ type: Boolean,
163
+ description: `Initialize a full \`${configs.tailwind}\` file`
164
+ },
165
+ "--postcss": {
118
166
  type: Boolean,
119
- description: 'Initialize a full `tailwind.config.js` file'
167
+ description: `Initialize a \`${configs.postcss}\` file`
120
168
  },
121
- '--postcss': {
169
+ "--types": {
122
170
  type: Boolean,
123
- description: 'Initialize a `postcss.config.js` file'
171
+ description: `Add TypeScript types for the \`${configs.tailwind}\` file`
124
172
  },
125
- '-f': '--full',
126
- '-p': '--postcss'
173
+ "-f": "--full",
174
+ "-p": "--postcss"
127
175
  }
128
176
  },
129
177
  build: {
130
178
  run: build,
131
179
  args: {
132
- '--input': {
180
+ "--input": {
133
181
  type: String,
134
- description: 'Input file'
182
+ description: "Input file"
135
183
  },
136
- '--output': {
184
+ "--output": {
137
185
  type: String,
138
- description: 'Output file'
186
+ description: "Output file"
187
+ },
188
+ "--watch": {
189
+ type: Boolean,
190
+ description: "Watch for changes and rebuild as needed"
139
191
  },
140
- '--watch': {
192
+ "--poll": {
141
193
  type: Boolean,
142
- description: 'Watch for changes and rebuild as needed'
194
+ description: "Use polling instead of filesystem events when watching"
143
195
  },
144
- '--content': {
196
+ "--content": {
145
197
  type: String,
146
- description: 'Content paths to use for removing unused classes'
198
+ description: "Content paths to use for removing unused classes"
147
199
  },
148
- '--purge': {
200
+ "--purge": {
149
201
  type: String,
150
202
  deprecated: true
151
203
  },
152
- '--postcss': {
204
+ "--postcss": {
153
205
  type: oneOf(String, Boolean),
154
- description: 'Load custom PostCSS configuration'
206
+ description: "Load custom PostCSS configuration"
155
207
  },
156
- '--minify': {
208
+ "--minify": {
157
209
  type: Boolean,
158
- description: 'Minify the output'
210
+ description: "Minify the output"
159
211
  },
160
- '--config': {
212
+ "--config": {
161
213
  type: String,
162
- description: 'Path to a custom config file'
214
+ description: "Path to a custom config file"
163
215
  },
164
- '--no-autoprefixer': {
216
+ "--no-autoprefixer": {
165
217
  type: Boolean,
166
- description: 'Disable autoprefixer'
218
+ description: "Disable autoprefixer"
167
219
  },
168
- '-c': '--config',
169
- '-i': '--input',
170
- '-o': '--output',
171
- '-m': '--minify',
172
- '-w': '--watch'
220
+ "-c": "--config",
221
+ "-i": "--input",
222
+ "-o": "--output",
223
+ "-m": "--minify",
224
+ "-w": "--watch",
225
+ "-p": "--poll"
173
226
  }
174
227
  }
175
228
  };
176
229
  let sharedFlags = {
177
- '--help': {
230
+ "--help": {
178
231
  type: Boolean,
179
- description: 'Display usage information'
232
+ description: "Display usage information"
180
233
  },
181
- '-h': '--help'
234
+ "-h": "--help"
182
235
  };
183
236
  if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined
184
237
  ))) {
185
238
  help({
186
239
  usage: [
187
- 'tailwindcss [--input input.css] [--output output.css] [--watch] [options...]',
188
- 'tailwindcss init [--full] [--postcss] [options...]',
240
+ "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
241
+ "tailwindcss init [--full] [--postcss] [--types] [options...]",
189
242
  ],
190
- commands: Object.keys(commands).filter((command)=>command !== 'build'
191
- ).map((command)=>`${command} [options]`
243
+ commands: Object.keys(commands).filter((command2)=>command2 !== "build"
244
+ ).map((command3)=>`${command3} [options]`
192
245
  ),
193
246
  options: {
194
247
  ...commands.build.args,
@@ -197,21 +250,21 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
197
250
  });
198
251
  process.exit(0);
199
252
  }
200
- let command = ((arg = '')=>arg.startsWith('-') ? undefined : arg
201
- )(process.argv[2]) || 'build';
253
+ let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg
254
+ )(process.argv[2]) || "build";
202
255
  if (commands[command] === undefined) {
203
256
  if (_fs.default.existsSync(_path.default.resolve(command))) {
204
257
  // TODO: Deprecate this in future versions
205
258
  // Check if non-existing command, might be a file.
206
- command = 'build';
259
+ command = "build";
207
260
  } else {
208
261
  help({
209
262
  message: `Invalid command: ${command}`,
210
263
  usage: [
211
- 'tailwindcss <command> [options]'
264
+ "tailwindcss <command> [options]"
212
265
  ],
213
- commands: Object.keys(commands).filter((command)=>command !== 'build'
214
- ).map((command)=>`${command} [options]`
266
+ commands: Object.keys(commands).filter((command4)=>command4 !== "build"
267
+ ).map((command5)=>`${command5} [options]`
215
268
  ),
216
269
  options: sharedFlags
217
270
  });
@@ -230,33 +283,33 @@ let args = (()=>{
230
283
  return !(value === null || value === void 0 ? void 0 : (ref = value.type) === null || ref === void 0 ? void 0 : ref.manualParsing);
231
284
  }).map(([key, value])=>[
232
285
  key,
233
- typeof value === 'object' ? value.type : value
286
+ typeof value === "object" ? value.type : value
234
287
  ]
235
288
  )), {
236
289
  permissive: true
237
290
  });
238
291
  // Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
239
- for(let i = result['_'].length - 1; i >= 0; --i){
240
- let flag = result['_'][i];
241
- if (!flag.startsWith('-')) continue;
292
+ for(let i = result["_"].length - 1; i >= 0; --i){
293
+ let flag = result["_"][i];
294
+ if (!flag.startsWith("-")) continue;
242
295
  let flagName = flag;
243
296
  let handler = flags[flag];
244
297
  // Resolve flagName & handler
245
- while(typeof handler === 'string'){
298
+ while(typeof handler === "string"){
246
299
  flagName = handler;
247
300
  handler = flags[handler];
248
301
  }
249
302
  if (!handler) continue;
250
- let args = [];
303
+ let args1 = [];
251
304
  let offset = i + 1;
252
305
  // Parse args for current flag
253
- while(result['_'][offset] && !result['_'][offset].startsWith('-')){
254
- args.push(result['_'][offset++]);
306
+ while(result["_"][offset] && !result["_"][offset].startsWith("-")){
307
+ args1.push(result["_"][offset++]);
255
308
  }
256
309
  // Cleanup manually parsed flags + args
257
- result['_'].splice(i, 1 + args.length);
310
+ result["_"].splice(i, 1 + args1.length);
258
311
  // Set the resolved value in the `result` object
259
- result[flagName] = handler.type(args.length === 0 ? undefined : args.length === 1 ? args[0] : args, flagName);
312
+ result[flagName] = handler.type(args1.length === 0 ? undefined : args1.length === 1 ? args1[0] : args1, flagName);
260
313
  }
261
314
  // Ensure that the `command` is always the first argument in the `args`.
262
315
  // This is important so that we don't have to check if a default command
@@ -264,16 +317,16 @@ let args = (()=>{
264
317
  //
265
318
  // E.g.: tailwindcss input.css -> _: ['build', 'input.css']
266
319
  // E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
267
- if (result['_'][0] !== command) {
268
- result['_'].unshift(command);
320
+ if (result["_"][0] !== command) {
321
+ result["_"].unshift(command);
269
322
  }
270
323
  return result;
271
324
  } catch (err) {
272
- if (err.code === 'ARG_UNKNOWN_OPTION') {
325
+ if (err.code === "ARG_UNKNOWN_OPTION") {
273
326
  help({
274
327
  message: err.message,
275
328
  usage: [
276
- 'tailwindcss <command> [options]'
329
+ "tailwindcss <command> [options]"
277
330
  ],
278
331
  options: sharedFlags
279
332
  });
@@ -282,7 +335,7 @@ let args = (()=>{
282
335
  throw err;
283
336
  }
284
337
  })();
285
- if (args['--help']) {
338
+ if (args["--help"]) {
286
339
  help({
287
340
  options: {
288
341
  ...flags,
@@ -299,23 +352,27 @@ run();
299
352
  function init() {
300
353
  let messages = [];
301
354
  var ref;
302
- let tailwindConfigLocation = _path.default.resolve((ref = args['_'][1]) !== null && ref !== void 0 ? ref : './tailwind.config.js');
355
+ let tailwindConfigLocation = _path.default.resolve((ref = args["_"][1]) !== null && ref !== void 0 ? ref : `./${configs.tailwind}`);
303
356
  if (_fs.default.existsSync(tailwindConfigLocation)) {
304
357
  messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
305
358
  } else {
306
- let stubFile = _fs.default.readFileSync(args['--full'] ? _path.default.resolve(__dirname, '../stubs/defaultConfig.stub.js') : _path.default.resolve(__dirname, '../stubs/simpleConfig.stub.js'), 'utf8');
359
+ 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
+ }
307
364
  // Change colors import
308
- stubFile = stubFile.replace('../colors', 'tailwindcss/colors');
309
- _fs.default.writeFileSync(tailwindConfigLocation, stubFile, 'utf8');
365
+ stubFile = stubFile.replace("../colors", "tailwindcss/colors");
366
+ _fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
310
367
  messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
311
368
  }
312
- if (args['--postcss']) {
313
- let postcssConfigLocation = _path.default.resolve('./postcss.config.js');
369
+ if (args["--postcss"]) {
370
+ let postcssConfigLocation = _path.default.resolve(`./${configs.postcss}`);
314
371
  if (_fs.default.existsSync(postcssConfigLocation)) {
315
372
  messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`);
316
373
  } else {
317
- let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, '../stubs/defaultPostCssConfig.stub.js'), 'utf8');
318
- _fs.default.writeFileSync(postcssConfigLocation, stubFile, 'utf8');
374
+ let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, "../stubs/defaultPostCssConfig.stub.js"), "utf8");
375
+ _fs.default.writeFileSync(postcssConfigLocation, stubFile, "utf8");
319
376
  messages.push(`Created PostCSS config file: ${_path.default.basename(postcssConfigLocation)}`);
320
377
  }
321
378
  }
@@ -327,50 +384,56 @@ function init() {
327
384
  }
328
385
  }
329
386
  async function build() {
330
- let input = args['--input'];
331
- let output = args['--output'];
332
- let shouldWatch = args['--watch'];
333
- let includePostCss = args['--postcss'];
387
+ let input = args["--input"];
388
+ let output = args["--output"];
389
+ let shouldWatch = args["--watch"];
390
+ let shouldPoll = args["--poll"];
391
+ let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32";
392
+ let includePostCss = args["--postcss"];
393
+ // Polling interval in milliseconds
394
+ // Used only when polling or coalescing add/change events on Windows
395
+ let pollInterval = 10;
334
396
  // TODO: Deprecate this in future versions
335
- if (!input && args['_'][1]) {
336
- console.error('[deprecation] Running tailwindcss without -i, please provide an input file.');
337
- input = args['--input'] = args['_'][1];
397
+ if (!input && args["_"][1]) {
398
+ console.error("[deprecation] Running tailwindcss without -i, please provide an input file.");
399
+ input = args["--input"] = args["_"][1];
338
400
  }
339
- if (input && !_fs.default.existsSync(input = _path.default.resolve(input))) {
340
- console.error(`Specified input file ${args['--input']} does not exist.`);
401
+ if (input && input !== "-" && !_fs.default.existsSync(input = _path.default.resolve(input))) {
402
+ console.error(`Specified input file ${args["--input"]} does not exist.`);
341
403
  process.exit(9);
342
404
  }
343
- if (args['--config'] && !_fs.default.existsSync(args['--config'] = _path.default.resolve(args['--config']))) {
344
- console.error(`Specified config file ${args['--config']} does not exist.`);
405
+ if (args["--config"] && !_fs.default.existsSync(args["--config"] = _path.default.resolve(args["--config"]))) {
406
+ console.error(`Specified config file ${args["--config"]} does not exist.`);
345
407
  process.exit(9);
346
408
  }
347
- let configPath = args['--config'] ? args['--config'] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null
348
- )(_path.default.resolve('./tailwind.config.js'));
409
+ let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null
410
+ )(_path.default.resolve(`./${configs.tailwind}`));
349
411
  async function loadPostCssPlugins() {
350
- let customPostCssPath = typeof args['--postcss'] === 'string' ? args['--postcss'] : undefined;
351
- let { plugins: configPlugins } = customPostCssPath ? await (async ()=>{
412
+ let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
413
+ let config1 = customPostCssPath ? await (async ()=>{
352
414
  let file = _path.default.resolve(customPostCssPath);
353
- // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.0.1/src/index.js
354
- let { config ={
355
- } } = await (0, _cosmiconfig).cosmiconfig('postcss').load(file);
356
- if (typeof config === 'function') {
415
+ // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
416
+ let { config ={} } = await (0, _lilconfig).lilconfig("postcss").load(file);
417
+ if (typeof config === "function") {
357
418
  config = config();
358
419
  } else {
359
- config = Object.assign({
360
- }, config);
420
+ config = Object.assign({}, config);
361
421
  }
362
422
  if (!config.plugins) {
363
423
  config.plugins = [];
364
424
  }
365
425
  return {
366
- plugins: (0, _plugins).default(config, file)
426
+ file,
427
+ plugins: (0, _plugins).default(config, file),
428
+ options: (0, _options).default(config, file)
367
429
  };
368
430
  })() : await (0, _postcssLoadConfig).default();
431
+ let configPlugins = config1.plugins;
369
432
  let configPluginTailwindIdx = configPlugins.findIndex((plugin)=>{
370
- if (typeof plugin === 'function' && plugin.name === 'tailwindcss') {
433
+ if (typeof plugin === "function" && plugin.name === "tailwindcss") {
371
434
  return true;
372
435
  }
373
- if (typeof plugin === 'object' && plugin !== null && plugin.postcssPlugin === 'tailwindcss') {
436
+ if (typeof plugin === "object" && plugin !== null && plugin.postcssPlugin === "tailwindcss") {
374
437
  return true;
375
438
  }
376
439
  return false;
@@ -379,25 +442,34 @@ async function build() {
379
442
  let afterPlugins = configPluginTailwindIdx === -1 ? configPlugins : configPlugins.slice(configPluginTailwindIdx + 1);
380
443
  return [
381
444
  beforePlugins,
382
- afterPlugins
445
+ afterPlugins,
446
+ config1.options
383
447
  ];
384
448
  }
385
449
  function resolveConfig() {
386
- let config = configPath ? require(configPath) : {
387
- };
388
- let resolvedConfig = (0, _resolveConfig).default(config);
389
- if (args['--purge']) {
390
- _log.default.warn('purge-flag-deprecated', [
391
- 'The `--purge` flag has been deprecated.',
392
- 'Please use `--content` instead.',
450
+ let config = configPath ? require(configPath) : {};
451
+ if (args["--purge"]) {
452
+ _log.default.warn("purge-flag-deprecated", [
453
+ "The `--purge` flag has been deprecated.",
454
+ "Please use `--content` instead.",
393
455
  ]);
394
- if (!args['--content']) {
395
- args['--content'] = args['--purge'];
456
+ if (!args["--content"]) {
457
+ args["--content"] = args["--purge"];
396
458
  }
397
459
  }
398
- if (args['--content']) {
399
- resolvedConfig.content = args['--content'].split(/(?<!{[^}]+),/);
460
+ if (args["--content"]) {
461
+ let files = args["--content"].split(/(?<!{[^}]+),/);
462
+ let resolvedConfig = (0, _resolveConfig).default(config, {
463
+ content: {
464
+ files
465
+ }
466
+ });
467
+ resolvedConfig.content.files = files;
468
+ resolvedConfig = (0, _validateConfigJs).validateConfig(resolvedConfig);
469
+ return resolvedConfig;
400
470
  }
471
+ let resolvedConfig = (0, _resolveConfig).default(config);
472
+ resolvedConfig = (0, _validateConfigJs).validateConfig(resolvedConfig);
401
473
  return resolvedConfig;
402
474
  }
403
475
  function extractFileGlobs(config) {
@@ -405,13 +477,13 @@ async function build() {
405
477
  // Strings in this case are files / globs. If it is something else,
406
478
  // like an object it's probably a raw content object. But this object
407
479
  // is not watchable, so let's remove it.
408
- return typeof file === 'string';
480
+ return typeof file === "string";
409
481
  }).map((glob)=>(0, _normalizePath).default(glob)
410
482
  );
411
483
  }
412
484
  function extractRawContent(config) {
413
485
  return config.content.files.filter((file)=>{
414
- return typeof file === 'object' && file !== null;
486
+ return typeof file === "object" && file !== null;
415
487
  });
416
488
  }
417
489
  function getChangedContent(config) {
@@ -421,12 +493,12 @@ async function build() {
421
493
  let files = _fastGlob.default.sync(globs);
422
494
  for (let file of files){
423
495
  changedContent.push({
424
- content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
496
+ content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"),
425
497
  extension: _path.default.extname(file).slice(1)
426
498
  });
427
499
  }
428
500
  // Resolve raw content in the tailwind config
429
- for (let { raw: content , extension ='html' } of extractRawContent(config)){
501
+ for (let { raw: content , extension ="html" } of extractRawContent(config)){
430
502
  changedContent.push({
431
503
  content,
432
504
  extension
@@ -439,7 +511,7 @@ async function build() {
439
511
  let changedContent = getChangedContent(config);
440
512
  let tailwindPlugin = ()=>{
441
513
  return {
442
- postcssPlugin: 'tailwindcss',
514
+ postcssPlugin: "tailwindcss",
443
515
  Once (root, { result }) {
444
516
  (0, _processTailwindFeatures).default(({ createContext })=>{
445
517
  return ()=>{
@@ -450,27 +522,34 @@ async function build() {
450
522
  };
451
523
  };
452
524
  tailwindPlugin.postcss = true;
453
- let [beforePlugins, afterPlugins] = includePostCss ? await loadPostCssPlugins() : [
525
+ let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins() : [
526
+ [
527
+ (()=>{
528
+ try {
529
+ return require("postcss-import");
530
+ } catch {}
531
+ return (0, _indexJs).lazyPostcssImport();
532
+ })(),
533
+ ],
454
534
  [],
455
- []
535
+ {},
456
536
  ];
457
537
  let plugins = [
458
538
  ...beforePlugins,
459
539
  tailwindPlugin,
460
- !args['--minify'] && formatNodes,
540
+ !args["--minify"] && formatNodes,
461
541
  ...afterPlugins,
462
- !args['--no-autoprefixer'] && (()=>{
542
+ !args["--no-autoprefixer"] && (()=>{
463
543
  // Try to load a local `autoprefixer` version first
464
544
  try {
465
- return require('autoprefixer');
466
- } catch {
467
- }
545
+ return require("autoprefixer");
546
+ } catch {}
468
547
  return (0, _indexJs).lazyAutoprefixer();
469
548
  })(),
470
- args['--minify'] && (()=>{
549
+ args["--minify"] && (()=>{
471
550
  let options = {
472
551
  preset: [
473
- 'default',
552
+ "default",
474
553
  {
475
554
  cssDeclarationSorter: false
476
555
  }
@@ -478,19 +557,20 @@ async function build() {
478
557
  };
479
558
  // Try to load a local `cssnano` version first
480
559
  try {
481
- return require('cssnano');
482
- } catch {
483
- }
560
+ return require("cssnano");
561
+ } catch {}
484
562
  return (0, _indexJs).lazyCssnano()(options);
485
563
  })(),
486
564
  ].filter(Boolean);
487
- let processor = (0, _indexJs).postcss(plugins);
565
+ let postcss = loadPostcss();
566
+ let processor = postcss(plugins);
488
567
  function processCSS(css) {
489
568
  let start = process.hrtime.bigint();
490
569
  return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
491
570
  recursive: true
492
571
  }) : null
493
572
  ).then(()=>processor.process(css, {
573
+ ...postcssOptions,
494
574
  from: input,
495
575
  to: output
496
576
  })
@@ -499,19 +579,28 @@ async function build() {
499
579
  return process.stdout.write(result.css);
500
580
  }
501
581
  return Promise.all([
502
- _fs.default.promises.writeFile(output, result.css, ()=>true
503
- ),
504
- result.map && _fs.default.writeFile(output + '.map', result.map.toString(), ()=>true
505
- ),
582
+ outputFile(output, result.css),
583
+ result.map && outputFile(output + ".map", result.map.toString()),
506
584
  ].filter(Boolean));
507
585
  }).then(()=>{
508
586
  let end = process.hrtime.bigint();
509
587
  console.error();
510
- console.error('Done in', (end - start) / BigInt(1000000) + 'ms.');
588
+ console.error("Done in", (end - start) / BigInt(1000000) + "ms.");
511
589
  });
512
590
  }
513
- let css = input ? _fs.default.readFileSync(_path.default.resolve(input), 'utf8') : '@tailwind base; @tailwind components; @tailwind utilities';
514
- return processCSS(css);
591
+ let css1 = await (()=>{
592
+ // Piping in data, let's drain the stdin
593
+ if (input === "-") {
594
+ return drainStdin();
595
+ }
596
+ // Input file has been provided
597
+ if (input) {
598
+ return _fs.default.readFileSync(_path.default.resolve(input), "utf8");
599
+ }
600
+ // No input file provided, fallback to default atrules
601
+ return "@tailwind base; @tailwind components; @tailwind utilities";
602
+ })();
603
+ return processCSS(css1);
515
604
  }
516
605
  let context = null;
517
606
  async function startWatcher() {
@@ -520,9 +609,9 @@ async function build() {
520
609
  let contextDependencies = new Set();
521
610
  let watcher = null;
522
611
  function refreshConfig() {
523
- env.DEBUG && console.time('Module dependencies');
524
- for (let file of configDependencies){
525
- delete require.cache[require.resolve(file)];
612
+ env.DEBUG && console.time("Module dependencies");
613
+ for (let file1 of configDependencies){
614
+ delete require.cache[require.resolve(file1)];
526
615
  }
527
616
  if (configPath) {
528
617
  configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
@@ -531,7 +620,7 @@ async function build() {
531
620
  contextDependencies.add(dependency);
532
621
  }
533
622
  }
534
- env.DEBUG && console.timeEnd('Module dependencies');
623
+ env.DEBUG && console.timeEnd("Module dependencies");
535
624
  return resolveConfig();
536
625
  }
537
626
  let [beforePlugins, afterPlugins] = includePostCss ? await loadPostCssPlugins() : [
@@ -540,21 +629,20 @@ async function build() {
540
629
  ];
541
630
  let plugins = [
542
631
  ...beforePlugins,
543
- '__TAILWIND_PLUGIN_POSITION__',
544
- !args['--minify'] && formatNodes,
632
+ "__TAILWIND_PLUGIN_POSITION__",
633
+ !args["--minify"] && formatNodes,
545
634
  ...afterPlugins,
546
- !args['--no-autoprefixer'] && (()=>{
635
+ !args["--no-autoprefixer"] && (()=>{
547
636
  // Try to load a local `autoprefixer` version first
548
637
  try {
549
- return require('autoprefixer');
550
- } catch {
551
- }
638
+ return require("autoprefixer");
639
+ } catch {}
552
640
  return (0, _indexJs).lazyAutoprefixer();
553
641
  })(),
554
- args['--minify'] && (()=>{
642
+ args["--minify"] && (()=>{
555
643
  let options = {
556
644
  preset: [
557
- 'default',
645
+ "default",
558
646
  {
559
647
  cssDeclarationSorter: false
560
648
  }
@@ -562,42 +650,42 @@ async function build() {
562
650
  };
563
651
  // Try to load a local `cssnano` version first
564
652
  try {
565
- return require('cssnano');
566
- } catch {
567
- }
653
+ return require("cssnano");
654
+ } catch {}
568
655
  return (0, _indexJs).lazyCssnano()(options);
569
656
  })(),
570
657
  ].filter(Boolean);
571
658
  async function rebuild(config) {
572
- env.DEBUG && console.time('Finished in');
659
+ env.DEBUG && console.time("Finished in");
573
660
  let tailwindPlugin = ()=>{
574
661
  return {
575
- postcssPlugin: 'tailwindcss',
662
+ postcssPlugin: "tailwindcss",
576
663
  Once (root, { result }) {
577
- env.DEBUG && console.time('Compiling CSS');
664
+ env.DEBUG && console.time("Compiling CSS");
578
665
  (0, _processTailwindFeatures).default(({ createContext })=>{
579
666
  console.error();
580
- console.error('Rebuilding...');
667
+ console.error("Rebuilding...");
581
668
  return ()=>{
582
669
  if (context !== null) {
583
670
  context.changedContent = changedContent.splice(0);
584
671
  return context;
585
672
  }
586
- env.DEBUG && console.time('Creating context');
673
+ env.DEBUG && console.time("Creating context");
587
674
  context = createContext(config, changedContent.splice(0));
588
- env.DEBUG && console.timeEnd('Creating context');
675
+ env.DEBUG && console.timeEnd("Creating context");
589
676
  return context;
590
677
  };
591
678
  })(root, result);
592
- env.DEBUG && console.timeEnd('Compiling CSS');
679
+ env.DEBUG && console.timeEnd("Compiling CSS");
593
680
  }
594
681
  };
595
682
  };
596
683
  tailwindPlugin.postcss = true;
597
- let tailwindPluginIdx = plugins.indexOf('__TAILWIND_PLUGIN_POSITION__');
684
+ let tailwindPluginIdx = plugins.indexOf("__TAILWIND_PLUGIN_POSITION__");
598
685
  let copy = plugins.slice();
599
686
  copy.splice(tailwindPluginIdx, 1, tailwindPlugin);
600
- let processor = (0, _indexJs).postcss(copy);
687
+ let postcss = loadPostcss();
688
+ let processor = postcss(copy);
601
689
  function processCSS(css) {
602
690
  let start = process.hrtime.bigint();
603
691
  return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
@@ -609,7 +697,7 @@ async function build() {
609
697
  })
610
698
  ).then(async (result)=>{
611
699
  for (let message of result.messages){
612
- if (message.type === 'dependency') {
700
+ if (message.type === "dependency") {
613
701
  contextDependencies.add(message.file);
614
702
  }
615
703
  }
@@ -619,80 +707,95 @@ async function build() {
619
707
  if (!output) {
620
708
  return process.stdout.write(result.css);
621
709
  }
622
- await Promise.all([
623
- _fs.default.promises.writeFile(output, result.css, ()=>true
624
- ),
625
- result.map && _fs.default.writeFile(output + '.map', result.map.toString(), ()=>true
626
- ),
710
+ return Promise.all([
711
+ outputFile(output, result.css),
712
+ result.map && outputFile(output + ".map", result.map.toString()),
627
713
  ].filter(Boolean));
628
714
  }).then(()=>{
629
715
  let end = process.hrtime.bigint();
630
- console.error('Done in', (end - start) / BigInt(1000000) + 'ms.');
716
+ console.error("Done in", (end - start) / BigInt(1000000) + "ms.");
631
717
  }).catch((err)=>{
632
- if (err.name === 'CssSyntaxError') {
718
+ if (err.name === "CssSyntaxError") {
633
719
  console.error(err.toString());
634
720
  } else {
635
721
  console.error(err);
636
722
  }
637
723
  });
638
724
  }
639
- let css = input ? _fs.default.readFileSync(_path.default.resolve(input), 'utf8') : '@tailwind base; @tailwind components; @tailwind utilities';
640
- let result1 = await processCSS(css);
641
- env.DEBUG && console.timeEnd('Finished in');
725
+ let css2 = await (()=>{
726
+ // Piping in data, let's drain the stdin
727
+ if (input === "-") {
728
+ return drainStdin();
729
+ }
730
+ // Input file has been provided
731
+ if (input) {
732
+ return _fs.default.readFileSync(_path.default.resolve(input), "utf8");
733
+ }
734
+ // No input file provided, fallback to default atrules
735
+ return "@tailwind base; @tailwind components; @tailwind utilities";
736
+ })();
737
+ let result1 = await processCSS(css2);
738
+ env.DEBUG && console.timeEnd("Finished in");
642
739
  return result1;
643
740
  }
644
- let config = refreshConfig(configPath);
741
+ let config2 = refreshConfig(configPath);
645
742
  if (input) {
646
743
  contextDependencies.add(_path.default.resolve(input));
647
744
  }
648
745
  watcher = _chokidar.default.watch([
649
746
  ...contextDependencies,
650
- ...extractFileGlobs(config)
747
+ ...extractFileGlobs(config2)
651
748
  ], {
652
- ignoreInitial: true
749
+ usePolling: shouldPoll,
750
+ interval: shouldPoll ? pollInterval : undefined,
751
+ ignoreInitial: true,
752
+ awaitWriteFinish: shouldCoalesceWriteEvents ? {
753
+ stabilityThreshold: 50,
754
+ pollInterval: pollInterval
755
+ } : false
653
756
  });
654
757
  let chain = Promise.resolve();
655
- watcher.on('change', async (file)=>{
758
+ watcher.on("change", async (file)=>{
656
759
  if (contextDependencies.has(file)) {
657
- env.DEBUG && console.time('Resolve config');
760
+ env.DEBUG && console.time("Resolve config");
658
761
  context = null;
659
- config = refreshConfig(configPath);
660
- env.DEBUG && console.timeEnd('Resolve config');
661
- env.DEBUG && console.time('Watch new files');
662
- let globs = extractFileGlobs(config);
762
+ config2 = refreshConfig(configPath);
763
+ env.DEBUG && console.timeEnd("Resolve config");
764
+ env.DEBUG && console.time("Watch new files");
765
+ let globs = extractFileGlobs(config2);
663
766
  watcher.add(configDependencies);
664
767
  watcher.add(globs);
665
- env.DEBUG && console.timeEnd('Watch new files');
768
+ env.DEBUG && console.timeEnd("Watch new files");
666
769
  chain = chain.then(async ()=>{
667
- changedContent.push(...getChangedContent(config));
668
- await rebuild(config);
770
+ changedContent.push(...getChangedContent(config2));
771
+ await rebuild(config2);
669
772
  });
670
773
  } else {
671
774
  chain = chain.then(async ()=>{
672
775
  changedContent.push({
673
- content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
776
+ content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"),
674
777
  extension: _path.default.extname(file).slice(1)
675
778
  });
676
- await rebuild(config);
779
+ await rebuild(config2);
677
780
  });
678
781
  }
679
782
  });
680
- watcher.on('add', async (file)=>{
783
+ watcher.on("add", async (file)=>{
681
784
  chain = chain.then(async ()=>{
682
785
  changedContent.push({
683
- content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
786
+ content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"),
684
787
  extension: _path.default.extname(file).slice(1)
685
788
  });
686
- await rebuild(config);
789
+ await rebuild(config2);
687
790
  });
688
791
  });
689
792
  chain = chain.then(()=>{
690
- changedContent.push(...getChangedContent(config));
691
- return rebuild(config);
793
+ changedContent.push(...getChangedContent(config2));
794
+ return rebuild(config2);
692
795
  });
693
796
  }
694
797
  if (shouldWatch) {
695
- /* Abort the watcher if stdin is closed to avoid zombie processes */ process.stdin.on('end', ()=>process.exit(0)
798
+ /* Abort the watcher if stdin is closed to avoid zombie processes */ process.stdin.on("end", ()=>process.exit(0)
696
799
  );
697
800
  process.stdin.resume();
698
801
  startWatcher();