Adding bootstrap


In all the examples like this, installing bootstrap requires adding bootstrap in aurelia.json under dependencies section. But, when I create a new application with Aurelia CLI(v 0.33.1), I don’t see any bundles, or dependencies section. And, even if I create a dependencies section, still the require of bootstrap is not working.

Please help


The current cli creates new app with webpack as default setup, not requirejs (old default, many old tutorials were written using requirejs setup). You are another one who were confused by cli document.

Read the webpack section of cli doc first. For how to add various packages under webpack, you need to read more doc from webpack itself (which is not pleasant at all if you did not use webpack before).

If you want to follow requirejs path, when creating new app, choose customize, then choose requirejs.


If you exclude CLI from the equation all that is needed is npm i [package-name] --save


For the sake of completeness:

  1. Install necessary packages locally: yarn add jquery popper.js bootstrap
  2. Append the following lines to src/app.ts or src/app.js:
  3. Voilà !

The require sections will embed the necessary css and javascript files (and BS dependencies like jQuery and popper.js)



Your webpack.config may need the plugin section updated

new ProvidePlugin({
      'Promise': 'bluebird',
      $: "jquery",
      jQuery: "jquery",
      Popper: ['popper.js', 'default']


Well, I did not need it actually to make it fly. Did you?


I did. I’d get an error about popper otherwise


Strange… I just tried using Aurelia CLI (aurelia-cli@0.33.1) + default scaffolding process (ESNext…), then:

npm install bootstrap jquery popper.js --save

Then edited the app.js and appended following code:


This was enough to make BS4 alive for my app…

@elitmike, would you mind sharing your config? (CLI version, scaffolding variant…)


You know what, I don’t use pure bootstrap. I forgot about that, it’s been set up for some time now. I’m using this. I think the standard bootstrap handles popper properly


For standard Bootstrap v4 and above , it works, but you can also use bootstrap.bundle.js, which bundles necessary dependencies like popper.js.


Thanks. That helped. :slight_smile: