[英]Angular 6 CLI does not copy library's assets folder into dist folder
How to use an external javascript file in angular library?如何在角度库中使用外部 javascript 文件? Do we need to export that in public_api file?
我们需要将它导出到 public_api 文件中吗? Added an external JS file in asset folder of a custom library.
在自定义库的资产文件夹中添加了一个外部 JS 文件。 But it's not showing in Dist folder once it's build.
但是一旦构建,它就不会显示在 Dist 文件夹中。
The "assets" property of angular.json can be configured to include custom files in angular-cli webpack build. angular.json 的“assets”属性可以配置为在 angular-cli webpack 构建中包含自定义文件。 So, configure "assets" property value as an array.
因此,将“资产”属性值配置为数组。 For example:
例如:
" assets": ["assets""],
“
assets": ["assets""],
above configuration will copy asset folder into dist folder during the angular-cli webpack build.以上配置将在 angular-cli webpack 构建期间将资产文件夹复制到 dist 文件夹中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.