0

I'm new to js package managers and build tools so this seems a bit confusing to me.

I've set up a new ember app and I want to add the dependencies (foundation) in the recommended/conventional way. There seem to be two ways of adding this to your project, using bower or broccoli.

This page recommends using broccoli:

If you want to use the .scss version of Foundation, you should first configure your project to use broccoli-sass with:

npm install --save-dev broccoli-sass
and then rename your app/styles/app.css to app/styles/app.scss.

Then you can install Foundation using Bower with:

bower install --save-dev foundation
Now, inside your app/styles/app.scss, you can import the Foundation styles with:

@import 'bower_components/foundation/scss/normalize';
@import 'bower_components/foundation/scss/foundation';

whereas this recommends using bower.

$> bower install --save bootstrap
Afterwards add following two lines to your ember-cli-builds.js (or Brocfile.js if you are using an older version of Ember.js):

app.import(app.bowerDirectory + '/bootstrap/dist/js/bootstrap.js');
app.import(app.bowerDirectory + '/bootstrap/dist/css/bootstrap.css');

Could someone shed some light on what the difference between these is and which one is the better/recommended way?

Community
  • 1
  • 1
reggaemahn
  • 6,272
  • 6
  • 34
  • 59
  • A year in ember land is a long time, for instance there is no `broccoli.js` file anymore it has been replaced with `ember-cli-build.js`, most packages you ll want to use already have an ember-cli addon check out [ember-cli-foundation-sass](https://github.com/artificialio/ember-cli-foundation-sass) – Patsy Issa Sep 21 '15 at 10:33
  • Yes, I did notice that actually. However, there is a "devDependencies" section in the packages.json where broccoli seems to add foundation if I use the first method and adds foundation to the node modules folder. Both these are there in the default ember project. This is what makes it confusing. – reggaemahn Sep 21 '15 at 10:39
  • Broccoli is not a package manager, it's the build tool. when you install libs you have to tell the build tool that you want to use them – Patsy Issa Sep 21 '15 at 10:40
  • Makes sense. Thanks. – reggaemahn Sep 21 '15 at 10:42

1 Answers1

0

Official ember-cli documentation recommends to use bower: "Ember CLI uses Bower for dependency management"

Gennady Dogaev
  • 5,902
  • 1
  • 15
  • 23