(
files: string[],
outFolder: string,
opts: Opts = {}
)
| 2 | import {basename, join} from 'path' |
| 3 | import {type Opts, compile} from '#packages/cli-lib/compile.js' |
| 4 | export default async function compileFolder( |
| 5 | files: string[], |
| 6 | outFolder: string, |
| 7 | opts: Opts = {} |
| 8 | ): Promise<void[]> { |
| 9 | const results = await Promise.all(files.map(f => compile([f], opts))) |
| 10 | const outFiles = files.map(f => join(outFolder, basename(f))) |
| 11 | |
| 12 | return Promise.all( |
| 13 | outFiles.map((outFile, i) => outputFile(outFile, results[i] + '\n')) |
| 14 | ) |
| 15 | } |