masciugo
masciugo

Reputation: 1191

ember-cli packages installation

Why some npm packages for ember-cli (like ember-cli-simple-auth or ember-cli-simple-auth-token) needs to be installed with the following two statements

npm install --save-dev ember-cli-simple-auth-token
ember generate simple-auth-token

?

I don't actually understand the second one which apparently simply add a bower dependency:

bash me@imac1 ~/dev/wishhhh/ember $ ember generate simple-auth-token version: 0.1.2 installing Installing browser packages via Bower... cached git://github.com/simplabs/ember-simple-auth-component.git#0.6.7 Installed browser packages via Bower. Why do I need it?

Upvotes: 0

Views: 491

Answers (1)

jakecraige
jakecraige

Reputation: 2727

You are correct in that all it does is install a bower package.

The reason this is requires is it prevents duplicate bower dependencies in your app. Early in addon development, people were installing bower components with an npm postInstall hook. While this worked, it added a lot of extra file size and possible conflicting bower dependencies.

This is the current pattern that addon developers are using to include bower dependencies in your project. This will likely be changed in the future but that is why for now.

(Answered referencing ember-cli 0.1.2)

Upvotes: 1

Related Questions