Recommended way to include bootstrap library in Ember.JS ember-cli App

后端 未结 9 831
余生分开走
余生分开走 2020-11-28 21:18

I am trying to install properly Twitter Bootstrap in my current ember-cli project. I did install bootstrap with bower :

bower install --save bootstrap
         


        
9条回答
  •  难免孤独
    2020-11-28 21:23

    On the terminal (For those using Node Package Manager)

    npm install bootstrap --save
    

    Using ember-cli, to import your installed bootstrap

    Open the ember-cli-build.js file

    module.exports = function(defaults) {
      let app = new EmberApp(defaults, {
        // Add options here
      });
    app.import('node_modules/bootstrap/dist/css/bootstrap.min.css');
    app.import('node_modules/bootstrap/dist/js/bootstrap.min.js');
    

    That will do it if bootstrap is installed via the NPM installer.

    Do not do this:

    app.import('./node_modules/bootstrap/dist/css/bootstrap.min.css');
    app.import('./node_modules/bootstrap/dist/js/bootstrap.min.js');
    

提交回复
热议问题