2024-06-16 11:29:47 +08:00
|
|
|
import { spawn } from 'child_process'
|
2024-06-10 14:10:09 +08:00
|
|
|
/**
|
|
|
|
* **********
|
|
|
|
* 生成css文件
|
|
|
|
* **********
|
|
|
|
*/
|
2024-06-16 11:29:47 +08:00
|
|
|
// exec('')
|
|
|
|
|
|
|
|
const child = spawn(
|
|
|
|
'tailwindcss -i ./src/input.css -o ./public/output.css --watch',
|
|
|
|
[],
|
|
|
|
{
|
|
|
|
shell: true,
|
|
|
|
stdio: 'inherit'
|
|
|
|
}
|
|
|
|
)
|
|
|
|
/**
|
|
|
|
* *************
|
|
|
|
* exit
|
|
|
|
* *************
|
|
|
|
*/
|
|
|
|
process.on('SIGINT', () => {
|
|
|
|
if (child.pid) process.kill(child.pid)
|
|
|
|
if (process.pid) process.exit()
|
|
|
|
})
|