| 9 | import fg from 'fast-glob'; |
| 10 | |
| 11 | const buildCss = async (inputPath, outputPaths) => { |
| 12 | const inputContent = await fs.readFile(inputPath, 'utf-8'); |
| 13 | |
| 14 | const result = await postcss([ |
| 15 | postcssImportExtGlob, |
| 16 | postcssImport, |
| 17 | tailwindcss, |
| 18 | autoprefixer, |
| 19 | cssnano |
| 20 | ]).process(inputContent, {from: inputPath}); |
| 21 | |
| 22 | for (const outputPath of outputPaths) { |
| 23 | await fs.mkdir(path.dirname(outputPath), {recursive: true}); |
| 24 | await fs.writeFile(outputPath, result.css); |
| 25 | } |
| 26 | |
| 27 | return result.css; |
| 28 | }; |
| 29 | |
| 30 | export const buildAllCss = async () => { |
| 31 | const tasks = []; |