Aurelia CLI将脚本引用添加到节点\模块文件夹
我正在尝试将Aurelia CLI将脚本引用添加到节点\模块文件夹,aurelia,Aurelia,我正在尝试将aurelia验证插件添加到我的应用程序中。在我的aurelia.json文件中,我已将模块添加到依赖项节点 "prepend": [ "node_modules/bluebird/js/browser/bluebird.core.js", "node_modules/aurelia-cli/lib/resources/scripts/configure-bluebird.js", "node_modules/requirejs/requi
aurelia验证
插件添加到我的应用程序中。在我的aurelia.json
文件中,我已将模块添加到依赖项
节点
"prepend": [
"node_modules/bluebird/js/browser/bluebird.core.js",
"node_modules/aurelia-cli/lib/resources/scripts/configure-bluebird.js",
"node_modules/requirejs/require.js"
],
"dependencies": [
... Trimmed other packages...
{
"name": "aurelia-validation",
"main": "aurelia-validation",
"path": "../node_modules/aurelia-validation/dist/amd",
"resources": []
}
]
当我在浏览器中查看index.html文件时,我在
中看到一个脚本标记,指向node_modules文件夹中的aurelia validation
这会导致运行时错误,因为我的web根目录中不存在该路径
为什么CLI会这样引用此模块?为什么它不能像我的其他文件一样捆绑它?大多数情况下,您可以使用
au import/install
在aurelia.json中安装/添加引用。查看。您是否尝试过使用au import
在aurelia.json中添加依赖项?看到了吧。你肯定在你的项目中安装了“npm安装”-ed aurelia验证吗?我不确定我是否忘了安装npm或者我的aurelia.json中的顺序有误。我用au-install重新安装了所有东西,解决了我的问题。谢谢在某些情况下,由于jquery,我遇到了引导程序无法加载的问题。还要注意,插件在依赖项中出现的顺序很重要。