use browserify options from package.json if available
See original GitHub issueOn a project that already have browserify transforms in the browserify field of package.json, it would be cool to not have to type them all on the bankai start
cli command as --js.transform… (And maybe to bankai build
as well)
Expected behavior:
The command should be able to guess if the user have configured browserify on the package.json file and use those by default.
Ugly patch for start.js:
--- left
+++ right
@@ -55,6 +55,10 @@
}
if (opts.js) {
+ try {
+ const pkgOpt = require(cwd + '/package.json').browserify;
+ opts.js = xtend(opts.js, pkgOpt);
+ } catch (e) {};
const js = bankai.js(browserify, entryFile, opts.js)
const route = opts.html.entry || '/bundle.js'
routes.push([route, js])
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Is it possible to specify browserify config in package.json ...
In case you haven't found an answer to this yet: Yes, it is and quite simple. You were very close. here's the example...
Read more >how to build modular applications with browserify - GitHub
For each xyz directory that exists, node will first look for an xyz/package.json to see if a "main" field exists. The "main" field...
Read more >Browserify
Here is a tutorial on how to use Browserify on the command line to bundle up a simple file called main.js along with...
Read more >Browserify - npm
Start using browserify in your project by running `npm i browserify`. ... the name given as a window global if no module system...
Read more >Getting Started with Browserify - SitePoint
When using Browserify, it'll look through all of your JS files that are imported and will only import each module that is mentioned...
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
Or some other way to tell bankai to inherit the config of browserify, like ava does for babel config:
I think this should work; if not passing
{ basedir: __dirname }
or something to browserify (js:
) in the constructor should probs resolve it - closing for now