chronocat/scripts/packengine.cts

29 lines
686 B
TypeScript
Raw Normal View History

2024-03-05 12:32:50 +00:00
import { cp, mkdir } from 'node:fs/promises'
import { join, resolve } from 'node:path'
void Promise.all(
['engine-chronocat-api', 'engine-chronocat-event'].map(async (x) => {
const srcPath = resolve(__dirname, `../packages/${x}/lib/index.js`)
2024-03-07 11:23:11 +00:00
const distDir = resolve(__dirname, `../build/dist/${x}`)
2024-03-05 12:32:50 +00:00
2024-03-07 11:23:11 +00:00
await mkdir(distDir, {
2024-03-05 12:32:50 +00:00
recursive: true,
})
2024-03-07 11:23:11 +00:00
const filename = `${x.slice(7)}.engine.js`
const distPath = join(distDir, filename)
await cp(srcPath, distPath)
2024-03-08 15:30:41 +00:00
// await cp(
// distPath,
// resolve(
// __dirname,
// `../build/dist/llqqnt/LiteLoaderQQNT-Plugin-Chronocat/src/${filename}`,
// ),
// )
2024-03-05 12:32:50 +00:00
}),
)