HenrikJoreteg / moonboots

A set of conventions and tools for bundle and serving clientside apps with node.js
159 stars 20 forks source link

allow setting individual transform options by passing in an array #65

Closed lukekarrys closed 9 years ago

lukekarrys commented 9 years ago

Browserify allows transforms to have options used like bundle.transform(transform, options).

The syntax to use these in the browserify key of a package.json file is [transform, options]. This PR allows the same syntax to be used with the browserify.transforms config option. The old syntax is still supported.

Here's an example of using it with jadeify to pass in options:

Old (still supported)

{
  browserify: {
    transforms: ['jadeify']
  }
}

New

{
  browserify: {
    transforms: [['jadeify', {pretty: true}]]
  }
}
nlf commented 9 years ago

While I don't really like this way of associating transforms with their options, if it's how browserify does it already then I think it's the best way to go. So :+1: from me