Urara-Blog/node_modules/.pnpm-store/v3/files/47/32050d1fc8f5dda4ac4bcb45882896f62cc18e4b86aef0a7ac7d562358c684ed6bfa8c3c90d02c6d8a43b1a88c57d737fda66d714fd0df7e4743fe682a30dd
2022-08-14 01:14:53 +08:00

42 lines
1.1 KiB
Text

import setupTrackingContext from './lib/setupTrackingContext'
import processTailwindFeatures from './processTailwindFeatures'
import { env } from './lib/sharedState'
module.exports = function tailwindcss(configOrPath) {
return {
postcssPlugin: 'tailwindcss',
plugins: [
env.DEBUG &&
function (root) {
console.log('\n')
console.time('JIT TOTAL')
return root
},
function (root, result) {
let context = setupTrackingContext(configOrPath)
if (root.type === 'document') {
let roots = root.nodes.filter((node) => node.type === 'root')
for (const root of roots) {
if (root.type === 'root') {
processTailwindFeatures(context)(root, result)
}
}
return
}
processTailwindFeatures(context)(root, result)
},
env.DEBUG &&
function (root) {
console.timeEnd('JIT TOTAL')
console.log('\n')
return root
},
].filter(Boolean),
}
}
module.exports.postcss = true