美文网首页
微前端-angular8打包去掉index.html和favic

微前端-angular8打包去掉index.html和favic

作者: 书中自有颜如玉__ | 来源:发表于2019-12-11 11:57 被阅读0次

微前端项目中整体打包并不需要子项目中的index.html和favicon.ico,甚至必须去除它,否则访问http://***/appName时会访问对应index.html,这不是我想要的。但是当我本地调试的时候,通常会独立运行,又少不了它,所以我需要控制调试的时候使用,打包时去除。

解决方法

1、angular.json文件中保留原来的配置


初始配置

2、如下位置新增代码

projects {
  ...
  appName {
    ...
    architect {
      ...
      build {
         ...
         configurations {
            ...
            production {
              ...
              "index": "",
              "assets": [
                 "src/assets"
              ],
              ...
            }
            ...
新增

搞定!

相关文章

网友评论

      本文标题:微前端-angular8打包去掉index.html和favic

      本文链接:https://www.haomeiwen.com/subject/ahsogctx.html