Adding Aurelia-bootstrap to the CLI

Whilst I am still encountering problems with the CLI it now runs for me.

I really wanted to add the module Aurelia-bootstrap to the project but it appears the info on the developer’s website is out of sync with the current version of the CLI.

He has provided the following details

Aurelia CLI
For Aurelia CLI there are a couple of things that need to be done. We need to install:

npm install aurelia-bootstrap -s
npm install velocity-animate -s
npm install tether -s
Once the packages are installed we need to indicate Aurelia CLI how to load the plugins. Add the following in your aurelia-project/aurelia.json project file:

"velocity-animate",
"tether",
{
  "name": "aurelia-bootstrap",
  "path": "../node_modules/aurelia-bootstrap/dist/amd",
  "main": "index",
  "resources": [
    "**/*.html"
  ]
}
Finally you need to indicate Aurelia to use the plugin. To do this find your main.js file and add the plugin:

export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging()
    .plugin('aurelia-bootstrap')
    .feature('resources');

  aurelia.start().then(() => aurelia.setRoot());
}

However the latest CLI does not have an aurelia.json so the setup will have changed.

I did run the following:

npm install aurelia-bootstrap -s
npm install velocity-animate -s
npm install tether -s

However I note that whilst it has loaded these into the node-modules directory it has not updated the package.json.

I am unsure how to add these to the package.json file and further to modify the main.ts as well as actually add and reference bootstrap 3.3.7 in the middle of all this…

What do I need to do to get this module to work with the latest CLI?

I strongly suggest you make a switch: install the cli version latest, and generate a new project with webpack (default option), then migrate the code over. Webpack is the dault bundler, and i think it will eliminate your issues related to the above.

@si2030
I’ve been following your struggle for a month or so.
Let’s try a different approach.

Let’s have you put up a road map. Where do you want to arrive.
What do you want to build in the end.
And see if we can build directions for you.
Instead of trying to solve ad hoc problems that arise on your journey.

Hi Alex,

After all that I managed to get my actual project working. Unfortunately, I am a beginner and very quickly I was having to deal with some pretty complicated data structures. Added to that was the wrinkle of custom templates and it was particularly confusing. In my case it was a data structure error on my behalf. Having fixed this I now have an end for end template for the rest of the project. Thanks for hanging in there. Incidentally the project is an accounting system for managing trade services.

1 Like