1 | import debug from 'debug'
|
2 | import {relative} from 'path'
|
3 | import {findOutputPath} from './findOutputPath'
|
4 | import {processFile} from './processFile'
|
5 |
|
6 | export 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 | }
|