I have the following in my aurelia.json file, the rest is what you usually find. I copied it directly from the reference implementation, and as you expect it to work fine.
{ 'build': { 'bundles': [ 'name': 'vendor-bundle.js' 'dependencies': [ "jquery", { "name": "bootstrap", "path": "../node_modules/bootstrap/dist", "main": "js/bootstrap.min", "deps": ["jquery"], "exports": "$", "resources": [ "css/bootstrap.css" ] } ] ] } }
However, I am trying to upgrade to Bootstrap 4 and it just doesn't work. To upgrade the package, I tried changing build.bundles.dependencies[].path to ../jspm_packages/github/twbs/ bootstrap@4.0.0-beta , as well as ../node_modules/bootstrap-v4-dev/dist , but it doesnβt changes the error code or does not make the error manifest smaller. I also tried copying v4 files to the dist folder for v3, which also causes the same problem.
The assembly is always clean; an error occurs at runtime:
DEBUG [templating] importing resources for app.html Uncaught TypeError: plugin.load is not a function Unhandled rejection Error: Failed loading required CSS file: bootstrap/css/bootstrap.css
EDIT:
Thanks to Ashley Grant's answer, I updated Bootstrap via NPM, aurelia.json any changes to aurelia.json . The error remains unchanged, which, apparently, indicates an error, if not for the fact that other people successfully completed this migration without errors, using the same chain of tools.
EDIT2:
I created the steps to reproduce the error:
$ au new name
cd to the project directory.
Add the two entries listed above to build.bundles[1].dependencies in aurelia_project/aurelia.json
$ npm install jquery --save $ npm install bootstrap@ ^4.0.0-beta --save
Change src/app.html to the following:
<template> <require from="bootstrap/css/bootstrap.css"></require> </template>
Finally, do one of the following and navigate to the provided URL.
$ au run
OR
$ au build $ serve
This gives the errors described in both Google Chrome Version 55.0.2883.87 (64-bit) and Mozilla Firefox 55.0.3 on my Arch Linux systems. I have not yet had the opportunity to test it on other systems.
Edit3:
Thanks @vidriduch everything works. However, if you look at the console, you will find the following:
Uncaught SyntaxError: Unexpected token export vendor-bundle.js:3927Uncaught Error: Mismatched anonymous define() module: [entirety of vendor-bundle.js printed here]
These are the first two messages when the page loads in debug mode, but no other errors occur.