specifying browserify options (plugins, extensions)
See original GitHub issuecurrently you can only specify browserify transforms using the browserify.transform
key in package.json. altlangs like typescript and coffeescript use custom (non-.js) extensions though which cannot be configured in package.json.
@yoshuawuyts & i chatted about this recently–adding some custom logic to bankai that reads additional configuration from the application’s package.json only (not from package.json in dependencies) could be a nice option:
// for typescript
{
"browserify": {
"plugin": [ "tsify" ]
}
}
// for coffeescript
{
"browserify": {
"extensions": [ ".coffee" ],
"transform": [ "coffeeify" ]
}
}
this still leaves out plugins that need things like functions in their options, but you could work around that by wrapping it in a small plugin like so:
// package.json
{
"browserify": {
"plugin": [ "./browserifyConfig" ]
}
}
// browserifyConfig.js
module.exports = function (b) {
b.plugin('some-plugin', { option: function () {} })
}
anyone have more thoughts on this?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
how to build modular applications with browserify - GitHub
setting the default extensions for .js and .json plus options configured in the opts.extensions parameter in the browserify constructor; configuring a global ...
Read more >How to specify browserify extensions in package.json?
Yes I know it works like that - but I want browserify to use my package.json settings. I don't want to put "extensions"...
Read more >Browserify
Browserify lets you require('modules') in the browser by bundling up all of your dependencies. Install Documentation · Source Code · Help + Articles...
Read more >rollup.js
Run rollup --help to see the available options and parameters. ... As some plugins rely on file extensions to process files, you can...
Read more >karma-browserify | Yarn - Package Manager
karma-browserify. owner nikku155.7kMIT8.1.0DT. A fast browserify integration for Karma that handles large projects with ease. karma-plugin ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just ran into this issue as well! Custom logic seems a bit hacky–is there any chance @substack would accept an upstream PR to add something like this to browserify core?
Alternately, perhaps we could carve out a typescript-specific solution? I feel like now that Choo has typescript support it would be great if Bankai supported it out-of-the-box too!
@goto-bus-stop yeah, that seems reasonable!