tailwindcss 0.0.0-oxide-insiders.dddaded → 0.0.0-oxide-insiders.b2e3cf2
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.
- package/lib/cli/build/deps.js +10 -18
- package/lib/cli/build/index.js +10 -41
- package/lib/cli/build/plugin.js +87 -268
- package/lib/cli/build/utils.js +18 -40
- package/lib/cli/build/watching.js +35 -151
- package/lib/cli/help/index.js +15 -58
- package/lib/cli/index.js +61 -120
- package/lib/cli/init/index.js +21 -43
- package/lib/cli-peer-dependencies.js +13 -15
- package/lib/cli.js +1 -5
- package/lib/corePluginList.js +3 -4
- package/lib/corePlugins.js +394 -857
- package/lib/featureFlags.js +14 -34
- package/lib/index.js +1 -5
- package/lib/lib/cacheInvalidation.js +29 -75
- package/lib/lib/collapseAdjacentRules.js +22 -43
- package/lib/lib/collapseDuplicateDeclarations.js +27 -68
- package/lib/lib/content.js +37 -126
- package/lib/lib/defaultExtractor.js +96 -199
- package/lib/lib/detectNesting.js +12 -36
- package/lib/lib/evaluateTailwindFunctions.js +101 -188
- package/lib/lib/expandApplyAtRules.js +177 -482
- package/lib/lib/expandTailwindAtRules.js +69 -237
- package/lib/lib/findAtConfigPath.js +13 -30
- package/lib/lib/generateRules.js +349 -765
- package/lib/lib/getModuleDependencies.js +27 -63
- package/lib/lib/load-config.js +16 -24
- package/lib/lib/normalizeTailwindDirectives.js +26 -70
- package/lib/lib/offsets.js +61 -224
- package/lib/lib/partitionApplyAtRules.js +29 -51
- package/lib/lib/regex.js +22 -30
- package/lib/lib/remap-bitfield.js +9 -84
- package/lib/lib/resolveDefaultsAtRules.js +50 -116
- package/lib/lib/setupContextUtils.js +576 -1099
- package/lib/lib/setupTrackingContext.js +54 -143
- package/lib/lib/sharedState.js +15 -59
- package/lib/lib/substituteScreenAtRules.js +8 -16
- package/lib/oxide/cli/build/deps.js +17 -32
- package/lib/oxide/cli/build/index.js +10 -40
- package/lib/oxide/cli/build/plugin.js +87 -267
- package/lib/oxide/cli/build/utils.js +18 -39
- package/lib/oxide/cli/build/watching.js +34 -149
- package/lib/oxide/cli/help/index.js +15 -57
- package/lib/oxide/cli/index.js +66 -127
- package/lib/oxide/cli/init/index.js +17 -36
- package/lib/oxide/cli.js +2 -3
- package/lib/plugin.js +30 -57
- package/lib/postcss-plugins/nesting/index.js +6 -10
- package/lib/postcss-plugins/nesting/plugin.js +17 -60
- package/lib/processTailwindFeatures.js +8 -37
- package/lib/public/colors.js +15 -22
- package/lib/public/create-plugin.js +5 -8
- package/lib/public/default-config.js +5 -9
- package/lib/public/default-theme.js +5 -9
- package/lib/public/load-config.js +4 -6
- package/lib/public/resolve-config.js +4 -6
- package/lib/util/applyImportantSelector.js +15 -24
- package/lib/util/bigSign.js +6 -7
- package/lib/util/buildMediaQuery.js +10 -17
- package/lib/util/cloneDeep.js +9 -17
- package/lib/util/cloneNodes.js +14 -27
- package/lib/util/color.js +45 -81
- package/lib/util/configurePlugins.js +9 -16
- package/lib/util/createPlugin.js +8 -15
- package/lib/util/createUtilityPlugin.js +15 -27
- package/lib/util/dataTypes.js +23 -144
- package/lib/util/defaults.js +9 -19
- package/lib/util/escapeClassName.js +6 -10
- package/lib/util/escapeCommas.js +6 -7
- package/lib/util/flattenColorPalette.js +6 -8
- package/lib/util/formatVariantSelector.js +49 -190
- package/lib/util/getAllConfigs.js +35 -42
- package/lib/util/hashConfig.js +6 -8
- package/lib/util/isKeyframeRule.js +6 -7
- package/lib/util/isPlainObject.js +8 -11
- package/lib/util/isSyntacticallyValidPropertyValue.js +13 -42
- package/lib/util/log.js +7 -14
- package/lib/util/nameClass.js +6 -21
- package/lib/util/negateValue.js +10 -26
- package/lib/util/normalizeConfig.js +63 -240
- package/lib/util/normalizeScreens.js +70 -137
- package/lib/util/parseAnimationValue.js +13 -61
- package/lib/util/parseBoxShadowValue.js +12 -57
- package/lib/util/parseDependency.js +13 -37
- package/lib/util/parseGlob.js +7 -22
- package/lib/util/parseObjectStyles.js +17 -26
- package/lib/util/pluginUtils.js +69 -176
- package/lib/util/prefixSelector.js +11 -28
- package/lib/util/pseudoElements.js +29 -105
- package/lib/util/removeAlphaVariables.js +8 -21
- package/lib/util/resolveConfig.js +103 -220
- package/lib/util/resolveConfigPath.js +12 -38
- package/lib/util/responsive.js +4 -6
- package/lib/util/splitAtTopLevelOnly.js +10 -44
- package/lib/util/tap.js +6 -8
- package/lib/util/toColorValue.js +6 -7
- package/lib/util/toPath.js +8 -26
- package/lib/util/transformThemeValue.js +12 -45
- package/lib/util/validateConfig.js +14 -22
- package/lib/util/validateFormalSyntax.js +5 -11
- package/lib/util/withAlphaVariable.js +28 -48
- package/package.json +3 -3
- package/peers/index.js +14 -16
- package/src/cli/build/plugin.js +1 -1
- package/src/cli.js +1 -1
- package/src/corePlugins.js +16 -17
- package/src/featureFlags.js +2 -3
- package/src/index.js +1 -5
- package/src/lib/expandTailwindAtRules.js +2 -2
- package/src/lib/sharedState.js +0 -15
- package/src/oxide/cli/build/plugin.ts +1 -1
- package/src/plugin.js +1 -1
|
@@ -1,272 +1,104 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
3
|
+
value: !0
|
|
4
|
+
}), Object.defineProperty(exports, "default", {
|
|
5
|
+
enumerable: !0,
|
|
7
6
|
get: ()=>expandTailwindAtRules
|
|
8
|
-
});
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
}), require("fs"), require("quick-lru");
|
|
8
|
+
const _sharedState = function(obj, nodeInterop) {
|
|
9
|
+
if (!nodeInterop && obj && obj.__esModule) return obj;
|
|
10
|
+
if (null === obj || "object" != typeof obj && "function" != typeof obj) return {
|
|
11
|
+
default: obj
|
|
12
|
+
};
|
|
13
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
14
|
+
if (cache && cache.has(obj)) return cache.get(obj);
|
|
15
|
+
var newObj = {}, hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
16
|
+
for(var key in obj)if ("default" !== key && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
17
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
18
|
+
desc && (desc.get || desc.set) ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key];
|
|
19
|
+
}
|
|
20
|
+
return newObj.default = obj, cache && cache.set(obj, newObj), newObj;
|
|
21
|
+
}(require("./sharedState")), _generateRules = require("./generateRules"), _log = _interopRequireDefault(require("../util/log")), _cloneNodes = _interopRequireDefault(require("../util/cloneNodes")), _defaultExtractor = require("./defaultExtractor");
|
|
16
22
|
function _interopRequireDefault(obj) {
|
|
17
23
|
return obj && obj.__esModule ? obj : {
|
|
18
24
|
default: obj
|
|
19
25
|
};
|
|
20
26
|
}
|
|
21
27
|
function _getRequireWildcardCache(nodeInterop) {
|
|
22
|
-
if (typeof WeakMap
|
|
23
|
-
var cacheBabelInterop = new WeakMap();
|
|
24
|
-
var cacheNodeInterop = new WeakMap();
|
|
28
|
+
if ("function" != typeof WeakMap) return null;
|
|
29
|
+
var cacheBabelInterop = new WeakMap(), cacheNodeInterop = new WeakMap();
|
|
25
30
|
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
26
31
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
27
32
|
})(nodeInterop);
|
|
28
33
|
}
|
|
29
|
-
function _interopRequireWildcard(obj, nodeInterop) {
|
|
30
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
34
|
-
return {
|
|
35
|
-
default: obj
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
39
|
-
if (cache && cache.has(obj)) {
|
|
40
|
-
return cache.get(obj);
|
|
41
|
-
}
|
|
42
|
-
var newObj = {};
|
|
43
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
44
|
-
for(var key in obj){
|
|
45
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
46
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
47
|
-
if (desc && (desc.get || desc.set)) {
|
|
48
|
-
Object.defineProperty(newObj, key, desc);
|
|
49
|
-
} else {
|
|
50
|
-
newObj[key] = obj[key];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
newObj.default = obj;
|
|
55
|
-
if (cache) {
|
|
56
|
-
cache.set(obj, newObj);
|
|
57
|
-
}
|
|
58
|
-
return newObj;
|
|
59
|
-
}
|
|
60
34
|
let env = _sharedState.env;
|
|
61
|
-
const builtInExtractors = {
|
|
62
|
-
DEFAULT: _defaultExtractor.defaultExtractor
|
|
63
|
-
};
|
|
64
|
-
const builtInTransformers = {
|
|
65
|
-
DEFAULT: (content)=>content,
|
|
66
|
-
svelte: (content)=>content.replace(/(?:^|\s)class:/g, " ")
|
|
67
|
-
};
|
|
68
|
-
function getExtractor(context, fileExtension) {
|
|
69
|
-
let extractors = context.tailwindConfig.content.extract;
|
|
70
|
-
return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context);
|
|
71
|
-
}
|
|
72
|
-
function getTransformer(tailwindConfig, fileExtension) {
|
|
73
|
-
let transformers = tailwindConfig.content.transform;
|
|
74
|
-
return transformers[fileExtension] || transformers.DEFAULT || builtInTransformers[fileExtension] || builtInTransformers.DEFAULT;
|
|
75
|
-
}
|
|
76
|
-
let extractorCache = new WeakMap();
|
|
77
|
-
// Scans template contents for possible classes. This is a hot path on initial build but
|
|
78
|
-
// not too important for subsequent builds. The faster the better though — if we can speed
|
|
79
|
-
// up these regexes by 50% that could cut initial build time by like 20%.
|
|
80
|
-
function getClassCandidates(content, extractor, candidates, seen) {
|
|
81
|
-
if (!extractorCache.has(extractor)) {
|
|
82
|
-
extractorCache.set(extractor, new _quickLru.default({
|
|
83
|
-
maxSize: 25000
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
|
-
for (let line of content.split("\n")){
|
|
87
|
-
line = line.trim();
|
|
88
|
-
if (seen.has(line)) {
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
seen.add(line);
|
|
92
|
-
if (extractorCache.get(extractor).has(line)) {
|
|
93
|
-
for (let match of extractorCache.get(extractor).get(line)){
|
|
94
|
-
candidates.add(match);
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
let extractorMatches = extractor(line).filter((s)=>s !== "!*");
|
|
98
|
-
let lineMatchesSet = new Set(extractorMatches);
|
|
99
|
-
for (let match of lineMatchesSet){
|
|
100
|
-
candidates.add(match);
|
|
101
|
-
}
|
|
102
|
-
extractorCache.get(extractor).set(line, lineMatchesSet);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
* @param {[import('./offsets.js').RuleOffset, import('postcss').Node][]} rules
|
|
109
|
-
* @param {*} context
|
|
110
|
-
*/ function buildStylesheet(rules, context) {
|
|
111
|
-
let sortedRules = context.offsets.sort(rules);
|
|
112
|
-
let returnValue = {
|
|
113
|
-
base: new Set(),
|
|
114
|
-
defaults: new Set(),
|
|
115
|
-
components: new Set(),
|
|
116
|
-
utilities: new Set(),
|
|
117
|
-
variants: new Set()
|
|
118
|
-
};
|
|
119
|
-
for (let [sort, rule] of sortedRules){
|
|
120
|
-
returnValue[sort.layer].add(rule);
|
|
121
|
-
}
|
|
122
|
-
return returnValue;
|
|
123
|
-
}
|
|
124
35
|
function expandTailwindAtRules(context) {
|
|
125
36
|
return (root)=>{
|
|
37
|
+
var _context_candidates;
|
|
126
38
|
let layerNodes = {
|
|
127
39
|
base: null,
|
|
128
40
|
components: null,
|
|
129
41
|
utilities: null,
|
|
130
42
|
variants: null
|
|
131
43
|
};
|
|
132
|
-
root.walkAtRules((rule)=>{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// file as a dependency since the output of this CSS does not depend on
|
|
136
|
-
// the source of any templates. Think Vue <style> blocks for example.
|
|
137
|
-
if (rule.name === "tailwind") {
|
|
138
|
-
if (Object.keys(layerNodes).includes(rule.params)) {
|
|
139
|
-
layerNodes[rule.params] = rule;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
if (Object.values(layerNodes).every((n)=>n === null)) {
|
|
144
|
-
return root;
|
|
145
|
-
}
|
|
146
|
-
var _context_candidates;
|
|
147
|
-
// ---
|
|
148
|
-
// Find potential rules in changed files
|
|
44
|
+
if (root.walkAtRules((rule)=>{
|
|
45
|
+
"tailwind" === rule.name && Object.keys(layerNodes).includes(rule.params) && (layerNodes[rule.params] = rule);
|
|
46
|
+
}), Object.values(layerNodes).every((n)=>null === n)) return root;
|
|
149
47
|
let candidates = new Set([
|
|
150
|
-
...(_context_candidates = context.candidates)
|
|
48
|
+
...null !== (_context_candidates = context.candidates) && void 0 !== _context_candidates ? _context_candidates : [],
|
|
151
49
|
_sharedState.NOT_ON_DEMAND
|
|
152
50
|
]);
|
|
153
|
-
let
|
|
154
|
-
env.DEBUG && console.time("Reading changed files");
|
|
155
|
-
if (env.OXIDE) {
|
|
156
|
-
// TODO: Pass through or implement `extractor`
|
|
157
|
-
for (let candidate of require("@tailwindcss/oxide").parseCandidateStringsFromFiles(context.changedContent)){
|
|
158
|
-
candidates.add(candidate);
|
|
159
|
-
}
|
|
160
|
-
// for (let { file, content, extension } of context.changedContent) {
|
|
161
|
-
// let transformer = getTransformer(context.tailwindConfig, extension)
|
|
162
|
-
// let extractor = getExtractor(context, extension)
|
|
163
|
-
// getClassCandidatesOxide(file, transformer(content), extractor, candidates, seen)
|
|
164
|
-
// }
|
|
165
|
-
} else {
|
|
166
|
-
for (let { file , content , extension } of context.changedContent){
|
|
167
|
-
let transformer = getTransformer(context.tailwindConfig, extension);
|
|
168
|
-
let extractor = getExtractor(context, extension);
|
|
169
|
-
content = file ? _fs.default.readFileSync(file, "utf8") : content;
|
|
170
|
-
getClassCandidates(transformer(content), extractor, candidates, seen);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
51
|
+
for (let candidate of (env.DEBUG && console.time("Reading changed files"), require("@tailwindcss/oxide").parseCandidateStringsFromFiles(context.changedContent)))candidates.add(candidate);
|
|
173
52
|
env.DEBUG && console.timeEnd("Reading changed files");
|
|
174
|
-
// ---
|
|
175
|
-
// Generate the actual CSS
|
|
176
53
|
let classCacheCount = context.classCache.size;
|
|
177
|
-
env.DEBUG && console.time("Generate rules")
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
env.DEBUG && console.time("Build stylesheet");
|
|
191
|
-
if (context.stylesheetCache === null || context.classCache.size !== classCacheCount) {
|
|
192
|
-
context.stylesheetCache = buildStylesheet([
|
|
193
|
-
...context.ruleCache
|
|
194
|
-
], context);
|
|
195
|
-
}
|
|
196
|
-
env.DEBUG && console.timeEnd("Build stylesheet");
|
|
54
|
+
env.DEBUG && console.time("Generate rules"), env.DEBUG && console.time("Sorting candidates"), env.DEBUG && console.timeEnd("Sorting candidates"), (0, _generateRules.generateRules)(candidates, context), env.DEBUG && console.timeEnd("Generate rules"), env.DEBUG && console.time("Build stylesheet"), (null === context.stylesheetCache || context.classCache.size !== classCacheCount) && (context.stylesheetCache = function(rules, context) {
|
|
55
|
+
let sortedRules = context.offsets.sort(rules), returnValue = {
|
|
56
|
+
base: new Set(),
|
|
57
|
+
defaults: new Set(),
|
|
58
|
+
components: new Set(),
|
|
59
|
+
utilities: new Set(),
|
|
60
|
+
variants: new Set()
|
|
61
|
+
};
|
|
62
|
+
for (let [sort, rule] of sortedRules)returnValue[sort.layer].add(rule);
|
|
63
|
+
return returnValue;
|
|
64
|
+
}([
|
|
65
|
+
...context.ruleCache
|
|
66
|
+
], context)), env.DEBUG && console.timeEnd("Build stylesheet");
|
|
197
67
|
let { defaults: defaultNodes , base: baseNodes , components: componentNodes , utilities: utilityNodes , variants: screenNodes } = context.stylesheetCache;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
layer: "components"
|
|
214
|
-
}));
|
|
215
|
-
layerNodes.components.remove();
|
|
216
|
-
}
|
|
217
|
-
if (layerNodes.utilities) {
|
|
218
|
-
layerNodes.utilities.before((0, _cloneNodes.default)([
|
|
219
|
-
...utilityNodes
|
|
220
|
-
], layerNodes.utilities.source, {
|
|
221
|
-
layer: "utilities"
|
|
222
|
-
}));
|
|
223
|
-
layerNodes.utilities.remove();
|
|
224
|
-
}
|
|
225
|
-
// We do post-filtering to not alter the emitted order of the variants
|
|
226
|
-
const variantNodes = Array.from(screenNodes).filter((node)=>{
|
|
68
|
+
layerNodes.base && (layerNodes.base.before((0, _cloneNodes.default)([
|
|
69
|
+
...baseNodes,
|
|
70
|
+
...defaultNodes
|
|
71
|
+
], layerNodes.base.source, {
|
|
72
|
+
layer: "base"
|
|
73
|
+
})), layerNodes.base.remove()), layerNodes.components && (layerNodes.components.before((0, _cloneNodes.default)([
|
|
74
|
+
...componentNodes
|
|
75
|
+
], layerNodes.components.source, {
|
|
76
|
+
layer: "components"
|
|
77
|
+
})), layerNodes.components.remove()), layerNodes.utilities && (layerNodes.utilities.before((0, _cloneNodes.default)([
|
|
78
|
+
...utilityNodes
|
|
79
|
+
], layerNodes.utilities.source, {
|
|
80
|
+
layer: "utilities"
|
|
81
|
+
})), layerNodes.utilities.remove());
|
|
82
|
+
let variantNodes = Array.from(screenNodes).filter((node)=>{
|
|
227
83
|
var _node_raws_tailwind;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return layerNodes.components !== null;
|
|
231
|
-
}
|
|
232
|
-
if (parentLayer === "utilities") {
|
|
233
|
-
return layerNodes.utilities !== null;
|
|
234
|
-
}
|
|
235
|
-
return true;
|
|
84
|
+
let parentLayer = null === (_node_raws_tailwind = node.raws.tailwind) || void 0 === _node_raws_tailwind ? void 0 : _node_raws_tailwind.parentLayer;
|
|
85
|
+
return "components" === parentLayer ? null !== layerNodes.components : "utilities" !== parentLayer || null !== layerNodes.utilities;
|
|
236
86
|
});
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
root.append((0, _cloneNodes.default)(variantNodes, root.source, {
|
|
244
|
-
layer: "variants"
|
|
245
|
-
}));
|
|
246
|
-
}
|
|
247
|
-
// If we've got a utility layer and no utilities are generated there's likely something wrong
|
|
248
|
-
const hasUtilityVariants = variantNodes.some((node)=>{
|
|
87
|
+
layerNodes.variants ? (layerNodes.variants.before((0, _cloneNodes.default)(variantNodes, layerNodes.variants.source, {
|
|
88
|
+
layer: "variants"
|
|
89
|
+
})), layerNodes.variants.remove()) : variantNodes.length > 0 && root.append((0, _cloneNodes.default)(variantNodes, root.source, {
|
|
90
|
+
layer: "variants"
|
|
91
|
+
}));
|
|
92
|
+
let hasUtilityVariants = variantNodes.some((node)=>{
|
|
249
93
|
var _node_raws_tailwind;
|
|
250
|
-
return ((_node_raws_tailwind = node.raws.tailwind)
|
|
94
|
+
return (null === (_node_raws_tailwind = node.raws.tailwind) || void 0 === _node_raws_tailwind ? void 0 : _node_raws_tailwind.parentLayer) === "utilities";
|
|
251
95
|
});
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
// ---
|
|
259
|
-
if (env.DEBUG) {
|
|
260
|
-
console.log("Potential classes: ", candidates.size);
|
|
261
|
-
console.log("Active contexts: ", _sharedState.contextSourcesMap.size);
|
|
262
|
-
}
|
|
263
|
-
// Clear the cache for the changed files
|
|
264
|
-
context.changedContent = [];
|
|
265
|
-
// Cleanup any leftover @layer atrules
|
|
266
|
-
root.walkAtRules("layer", (rule)=>{
|
|
267
|
-
if (Object.keys(layerNodes).includes(rule.params)) {
|
|
268
|
-
rule.remove();
|
|
269
|
-
}
|
|
96
|
+
layerNodes.utilities && 0 === utilityNodes.size && !hasUtilityVariants && _log.default.warn("content-problems", [
|
|
97
|
+
"No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.",
|
|
98
|
+
"https://tailwindcss.com/docs/content-configuration"
|
|
99
|
+
]), env.DEBUG && (console.log("Potential classes: ", candidates.size), console.log("Active contexts: ", _sharedState.contextSourcesMap.size)), context.changedContent = [], root.walkAtRules("layer", (rule)=>{
|
|
100
|
+
Object.keys(layerNodes).includes(rule.params) && rule.remove();
|
|
270
101
|
});
|
|
271
102
|
};
|
|
272
103
|
}
|
|
104
|
+
_defaultExtractor.defaultExtractor, new WeakMap();
|
|
@@ -1,44 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
3
|
+
value: !0
|
|
4
|
+
}), Object.defineProperty(exports, "findAtConfigPath", {
|
|
5
|
+
enumerable: !0,
|
|
7
6
|
get: ()=>findAtConfigPath
|
|
8
7
|
});
|
|
9
|
-
const _fs =
|
|
10
|
-
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
|
8
|
+
const _fs = _interopRequireDefault(require("fs")), _path = _interopRequireDefault(require("path"));
|
|
11
9
|
function _interopRequireDefault(obj) {
|
|
12
10
|
return obj && obj.__esModule ? obj : {
|
|
13
11
|
default: obj
|
|
14
12
|
};
|
|
15
13
|
}
|
|
16
14
|
function findAtConfigPath(root, result) {
|
|
17
|
-
let configPath = null;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
relativeTo = (_ref = (_rule_source_input_file = (_rule_source = rule.source) === null || _rule_source === void 0 ? void 0 : _rule_source.input.file) !== null && _rule_source_input_file !== void 0 ? _rule_source_input_file : result.opts.from) !== null && _ref !== void 0 ? _ref : null;
|
|
23
|
-
if (relativeTo === null) {
|
|
24
|
-
throw rule.error("The `@config` directive cannot be used without setting `from` in your PostCSS config.");
|
|
25
|
-
}
|
|
26
|
-
if (configPath) {
|
|
27
|
-
throw rule.error("Only one `@config` directive is allowed per file.");
|
|
28
|
-
}
|
|
15
|
+
let configPath = null, relativeTo = null;
|
|
16
|
+
return root.walkAtRules("config", (rule)=>{
|
|
17
|
+
var _rule_source, _rule_source_input_file, _ref;
|
|
18
|
+
if (null === (relativeTo = null !== (_ref = null !== (_rule_source_input_file = null === (_rule_source = rule.source) || void 0 === _rule_source ? void 0 : _rule_source.input.file) && void 0 !== _rule_source_input_file ? _rule_source_input_file : result.opts.from) && void 0 !== _ref ? _ref : null)) throw rule.error("The `@config` directive cannot be used without setting `from` in your PostCSS config.");
|
|
19
|
+
if (configPath) throw rule.error("Only one `@config` directive is allowed per file.");
|
|
29
20
|
let matches = rule.params.match(/(['"])(.*?)\1/);
|
|
30
|
-
if (!matches)
|
|
31
|
-
throw rule.error("A path is required when using the `@config` directive.");
|
|
32
|
-
}
|
|
21
|
+
if (!matches) throw rule.error("A path is required when using the `@config` directive.");
|
|
33
22
|
let inputPath = matches[2];
|
|
34
|
-
if (_path.default.isAbsolute(inputPath))
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
configPath = _path.default.resolve(_path.default.dirname(relativeTo), inputPath);
|
|
38
|
-
if (!_fs.default.existsSync(configPath)) {
|
|
39
|
-
throw rule.error(`The config file at "${inputPath}" does not exist. Make sure the path is correct and the file exists.`);
|
|
40
|
-
}
|
|
23
|
+
if (_path.default.isAbsolute(inputPath)) throw rule.error("The `@config` directive cannot be used with an absolute path.");
|
|
24
|
+
if (configPath = _path.default.resolve(_path.default.dirname(relativeTo), inputPath), !_fs.default.existsSync(configPath)) throw rule.error(`The config file at "${inputPath}" does not exist. Make sure the path is correct and the file exists.`);
|
|
41
25
|
rule.remove();
|
|
42
|
-
});
|
|
43
|
-
return configPath ? configPath : null;
|
|
26
|
+
}), configPath || null;
|
|
44
27
|
}
|