如何将外部库中的资源包含到Angular CLI项目中
我正在尝试下面,但这不起作用,
"assets": [ "../node_modules//assets/" ]
脚本工作正常,但是
"scripts": [ "../node_modules//some.js", "startup.js" ]
角度版本:2.4.1
Angular CLI:1.0.0-beta.24
有什么建议吗?
这确实存在!
修复#3555
要使用它,请更新.angular-cli.json文件,如此...
角度版本2-5:
"assets": [ "assets", { "glob": "**/*", "input": "../node_modules//assets/", "output": "./assets/" } ]
角度版本> = 6:
"assets": [ "src/favicon.ico", "src/assets", { "glob": "**/*", "input": "./node_modules// /", "output": "./assets/" },
由于角度6,配置略有变化.要实现这一点,请更改assets
相应构建器的属性angular.json
(请注意,架构师中至少有两个相关的构建器,build
并且test
!)
"assets": [ "src/favicon.ico", "src/assets", { "glob": "**/*", "input": "./node_modules// ", "output": "./assets/ " },