我们有一个 Angular 6 通用应用程序。我的应用程序突然开始出错。实际上 Assets 文件夹在生产构建后不会进入 dist。它工作正常,但突然没有将 assets 文件夹复制到 dist 文件夹中。
请帮忙看看是什么情况?
最佳答案
You use the
assets
array inside the build target inangular.json
to list files or folders you want to copy as-is when building your project. if you think you need to exclude files, consider not putting that thing in theassets
首先,我将使用 angular cli 6.x.x
更新项目。然后将您的 Assets 路径调整到您的 angular.json
中,如下所示:
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json",
"src/ngsw-worker-mod.js",
"src/sitemap.xml",
"src/robots.txt",
"src/sitemap_video.xml"
],
然后确保您永远不会尝试复制项目输出路径之外的文件。
第二种方法
如果你真的想使用 node glob 中的 glob
方法,我认为您需要确保它已按照说明的文档中的方式安装。
关于Angular CLI Assets 文件夹不会进入 dist 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52569779/