chronocat/scripts/packengine.cts

31 lines
743 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(
2024-09-07 06:05:45 +00:00
['engine-chronocat-api', 'engine-chronocat-event', 'engine-media'].map(
async (x) => {
const srcPath = resolve(__dirname, `../packages/${x}/lib/index.js`)
2024-03-05 12:32:50 +00:00
2024-09-07 06:05:45 +00:00
const distDir = resolve(__dirname, `../build/dist/${x}`)
2024-03-05 12:32:50 +00:00
2024-09-07 06:05:45 +00:00
await mkdir(distDir, {
recursive: true,
})
2024-03-05 12:32:50 +00:00
2024-09-07 06:05:45 +00:00
const filename = `${x.slice(7)}.engine.js`
2024-03-07 11:23:11 +00:00
2024-09-07 06:05:45 +00:00
const distPath = join(distDir, filename)
2024-03-07 11:23:11 +00:00
2024-09-07 06:05:45 +00:00
await cp(srcPath, distPath)
2024-03-07 11:23:11 +00:00
2024-09-07 06:05:45 +00:00
// await cp(
// distPath,
// resolve(
// __dirname,
// `../build/dist/llqqnt/LiteLoaderQQNT-Plugin-Chronocat/src/${filename}`,
// ),
// )
},
),
2024-03-05 12:32:50 +00:00
)