1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", {
|
3 | value: true
|
4 | });
|
5 | const _setupTrackingContext = _interopRequireDefault(require("./lib/setupTrackingContext"));
|
6 | const _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
|
7 | const _sharedState = require("./lib/sharedState");
|
8 | const _findAtConfigPath = require("./lib/findAtConfigPath");
|
9 | function _interopRequireDefault(obj) {
|
10 | return obj && obj.__esModule ? obj : {
|
11 | default: obj
|
12 | };
|
13 | }
|
14 | module.exports = function tailwindcss(configOrPath) {
|
15 | return {
|
16 | postcssPlugin: "tailwindcss",
|
17 | plugins: [
|
18 | _sharedState.env.DEBUG && function(root) {
|
19 | console.log("\n");
|
20 | console.time("JIT TOTAL");
|
21 | return root;
|
22 | },
|
23 | function(root, result) {
|
24 | var ref;
|
25 |
|
26 |
|
27 | configOrPath = (ref = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && ref !== void 0 ? ref : configOrPath;
|
28 | let context = (0, _setupTrackingContext.default)(configOrPath);
|
29 | if (root.type === "document") {
|
30 | let roots = root.nodes.filter((node)=>node.type === "root");
|
31 | for (const root1 of roots){
|
32 | if (root1.type === "root") {
|
33 | (0, _processTailwindFeatures.default)(context)(root1, result);
|
34 | }
|
35 | }
|
36 | return;
|
37 | }
|
38 | (0, _processTailwindFeatures.default)(context)(root, result);
|
39 | },
|
40 | _sharedState.env.DEBUG && function(root) {
|
41 | console.timeEnd("JIT TOTAL");
|
42 | console.log("\n");
|
43 | return root;
|
44 | }
|
45 | ].filter(Boolean)
|
46 | };
|
47 | };
|
48 | module.exports.postcss = true;
|