generated from sonofmagic/monorepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.js
35 lines (30 loc) · 822 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const fs = require('node:fs')
const path = require('pathe')
const postcss = require('postcss')
const tailwindcss = require('tailwindcss')
const { TailwindcssPatcher } = require('tailwindcss-patch')
async function main() {
const twPatcher = new TailwindcssPatcher()
twPatcher.patch()
const tw = tailwindcss({
mode: 'jit',
purge: {
content: [{
raw: 'w-[99px]',
}],
},
// corePlugins: {
// preflight: false
// }
})
const result = postcss([tw]).process(`@tailwind base;
@tailwind components;
@tailwind utilities;`)
// console.log(result.css)
fs.writeFileSync(path.join(__dirname, 'result.css'), result.css, 'utf8')
// const ctx = require('tailwindcss/lib/jit/index')
// console.log(ctx)
const ctx = twPatcher.getClassSet()
console.log(ctx)
}
main()