简体   繁体   中英

Should dependencies be installed with bower or broccoli in ember app?

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?

ember-cli官方文档建议使用Bower:“ Ember CLI使用Bower进行依赖性管理”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM