After starting with a new ionic app, I can see at bower.json
that comes with ionic is in devdependencies
. Why is it a devdependency
and not a normal dependency
?
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.0.0-rc.0"
},
Thanks, I feel confused right now
having devDependencies gives you the opportunity to simplify the steps that drive you from the source files (a git clone of the project) to the production ready app
when you don't need to make changes and (develop) the application, you could just run
or
they work the same
bower install options
bower documentation
npm install options
This way you take less time to ship the app and don't waste bandwidth downloading stuff you won't need.
Given that, to me, the choice of listing ionic as devDependecy is a poor one: it implies that I could take advantage of this choice to get ready the app for execution this way:
Now, if you ignore the content of /lib folder in your sources, this should not work, and if it works because the ionic-cli does some more checks to save your ass, I think this is unclear.
From what I understand,
dependencies
are required to run, anddevDependencies
are only for development, like minification, unit tests, etc.Both will install when you do
npm install
but onlydependencies
will install when you donpm install $package
, unless you add the--dev
option