kratiahuja / fastboot-transform

Transforms given broccoli tree that contains browser API to be fastboot complaint
14 stars 7 forks source link

Don't transform non-JS files #2

Closed dfreeman closed 7 years ago

dfreeman commented 7 years ago

If you have a tree with e.g. both CSS and JS in it, currently this would wrap the CSS as well, which would produce invalid output.

kratiahuja commented 7 years ago

@dfreeman thanks for the PR. This npm package assumed the incoming tree only contains JS files and was hoping the caller to filter and call. I am fine with merging this in either ways. I'll merge and release in a few days as I am traveling.

dfreeman commented 7 years ago

Thanks, no rush! This is definitely possible externally, but given how verbose it is (and that it would require extra processing for the funnel/merge), it seems nice to bake it in here 🙂

(input) => {
  return new MergeTrees([
    input,
    fastbootTransform(new Funnel(input, { include: '**/*.js' }))
  ], { overwrite: true });
}
kratiahuja commented 7 years ago

@dfreeman Agreed! I'll merge and release.

kratiahuja commented 7 years ago

@dfreeman fastboot-transform@v0.1.2 is released.

dfreeman commented 7 years ago

👍 Thanks!