我在我的aurelia.json文件中有以下内容,其中包括您通常会发现的其他内容.我直接从参考实现中复制它,正如您所期望的那样,它可以正常工作.
{
'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"
]
}
]
]
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我正在尝试迁移到Bootstrap 4,它似乎似乎没有工作.为了更新包,我试图改变build.bundles.dependencies[].path到../jspm_packages/github/twbs/bootstrap@4.0.0-beta以及到../node_modules/bootstrap-v4-dev/dist,但它不会改变错误代码或使误差表现任何减少.我也尝试将v4文件复制到v3的dist文件夹中,这也会导致同样的问题.
建筑总是干净的; 错误发生在运行时:
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
Run Code Online (Sandbox Code Playgroud)
编辑:
感谢Ashley Grant的回答,我通过NPM更新了Bootstrap,避免了任何更改aurelia.json.错误保持不变,这似乎表明存在一个错误,因为其他人没有使用相同的工具链成功执行此迁移而没有错误.
EDIT2:
我已经创建了重现错误的步骤:
$ au new
name # can be any …Run Code Online (Sandbox Code Playgroud)