Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate "browserify" configuration thru package.json #504

Open
cancerberoSgx opened this issue Jun 30, 2018 · 1 comment
Open

deprecate "browserify" configuration thru package.json #504

cancerberoSgx opened this issue Jun 30, 2018 · 1 comment

Comments

@cancerberoSgx
Copy link

Your official recommendation to configure browserify is thru package.json "browserify" property. It works fine (and bankai made a nice job on my project BTW) but unfortunately, if I'm building a library (something that can be required by others) having a browserify configuration in the package.json will probably give an error when my users try to run browserify on their own projects.

See browserify/browserify#1850 for details

An example, I just run bankai on my project which needed this in package.json:

 "browserify": {
     "transform": [
      ["babelify", {"presets": ["react"]}]
     ]
   },

Imagine that besides publishing my project in the web, I want to expose some APIs so others can require() my project. In that case, if they use browserify when they try generate the bundle on their projects, browserify will try to run that transformation and, that doesn't make any sense (since it's already compiled). For avoiding the problem I would have to include "babelify" and "babel-core" as "dependency" instead of "devDependency" in my project or manually remove the "browserify" property of my package.json on beforepublish.

So I would recommend you to at least document this, and in the future try to avoid configuring browserify like that - seems that kind of configuration is meant to run browserify when your project's dependencies compile, not when your project does. Also if I'm right you should provide other means of configuration.

Thanks for the tool, seems really good, keep it up !

@goto-bus-stop
Copy link
Member

I think the one exception to what I said in browserify/browserify#1850 is application level config. You're definitely right though that it collides if you have a library that also includes in its repo an example application using bankai…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants