所以我有一个使用 jspm 的 aurelia 设置。我已经像这样安装了 Bootstrap 4:
jspm install npm:bootstrap@4.0.0-alpha.2
然后在 main.js 我做了:
import 'jquery';
import 'bootstrap';
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
//Uncomment the line below to enable animation.
//aurelia.use.plugin('aurelia-animator-css');
//if the css animator is enabled, add swap-order="after" to all router-view elements
//Anyone wanting to use HTMLImports to load views, will need to install the following plugin.
//aurelia.use.plugin('aurelia-html-import-template-loader')
aurelia.start().then(() => aurelia.setRoot());
}
我什至尝试过import $ from 'jquery'
,但是当我用 BS4 启动 aurelia 骨架时,我得到:
Uncaught Error: Bootstrap's JavaScript requires jQuery
我可以去控制台做 $ 并返回 jquery 的东西。我认为这是一个竞争条件,但不知道如何解决?
编辑:System.config
System.config({
defaultJSExtensions: true,
transpiler: "none",
paths: {
"*": "dist/*",
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
meta: {
"bootstrap": {
"deps": [
"jquery"
]
}
},
map: {