UNPKG

550 BJavaScriptView Raw
1import debug from 'debug'
2import {relative} from 'path'
3import {findOutputPath} from './findOutputPath'
4import {processFile} from './processFile'
5
6export class Pipeline {
7 constructor (entry, destination) {
8 this.log = debug('unbundle')
9 this.entry = entry
10 this.destination = destination
11 }
12
13 async process (files) {
14 for (const file of files) {
15 const output = findOutputPath(file, this.entry, this.destination)
16 this.log(relative(process.cwd(), output))
17 await processFile(file, output, this.destination)
18 }
19 }
20}