Allow transforms to be configured with options
See original GitHub issueI’ve been messing around with my own transforms and see a lot of potential for them to replace certain grunt tasks I have, but I’d need to be able to pass them additional options.
I originally tweeted something along the lines of this on twitter and @substack replied saying currently the best way is using environment variables: https://twitter.com/substack/statuses/410566575117185024
I imagine them too look something like this:
browserify: {
transforms: [
"coffeeify",
{name: "ngtemplateify", module: "mod"}
]
}
Also regarding transforms, perhaps it would be good to be able to turn off module level transforms from these options, for example, lets say I’m using some special transforms that are in my karma config:
browserify: {
transforms: [
{name: "coffeeify", disable: true},
// not a published transform yet, but would use Ibrik to add
// coverage and at the same time convert coffee files to javascript
{name: "ibrikify"}
]
}
In that case, if I had a module level transform specifying “coffeeify”, my “ibrikify” transform would already have converted the coffee files to js and when the module level transform was applied it would throw an error. So, this would solve that problem without having to expose something like transformKey
as a browserify option to be able to set it to false
ignoring all module level transforms.
Issue Analytics
- State:
- Created 10 years ago
- Comments:47 (14 by maintainers)
Top GitHub Comments
So when one want to use parametric transformations in
package.json
one should use some third-party module? Which third-party module should be used for that?I think this issue must be illuminated in readme. This is important, because when someone uses browserify programmaticaly (for instance, in gulpfile or his own build script) parametric transforms can be used, but package.json could not provide such feature. In second case one will rely only on non-parametric transformations.
The “configuring transforms” landscape has changed quite a bit since this conversation took place. From the README:
If you’re writing a transform, (it’s been a while since I did this so I might have this wrong) I’m pretty sure it’s just a
function transform(file, config) {...}
. This seems to be where my browserify-transform-tools library gets it from. 😛