Miao-Yunzai/index.js

17 lines
491 B
JavaScript
Raw Normal View History

import { execSync, spawn } from 'child_process'
2024-06-10 00:37:59 +08:00
const argv = [...process.argv].splice(2)
const argvs = argv.join(' ').replace(/(\S+\.js|\S+\.ts)/g, '')
execSync('tailwindcss -i ./src/input.css -o ./public/output.css')
2024-06-10 00:37:59 +08:00
const child = spawn(
'node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.ts',
argvs.split(' '),
{
shell: true,
stdio: 'inherit'
}
)
process.on('SIGINT', () => {
if (child.pid) process.kill(child.pid)
if (process.pid) process.exit()
})