• angular 6 爬坑之旅


      自从2018年5月份,angular 6发布之后,相信用过angualr6的小伙伴一定和我一样,爬了很多坑了吧!下面把我爬过的坑总结一下:

      一.angular6 引入ng-zorro,没有样式。。。

       解决:在angular.josn文件中,添加 "node_modules/ng-zorro-antd/src/ng-zorro-antd.min.css"

          

     "styles": [
                  "node_modules/ng-zorro-antd/src/ng-zorro-antd.min.css",
                  "src/styles.css"
                ],

      二. angular配置proxy代理文件无效。。。

        解决:在package.json文件中,添加配置项"start": "ng s --proxy-config proxy.config.json --open",

      

    "scripts": {
        "ng": "ng",
        "start": "ng s --proxy-config proxy.config.json  --open",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
      },

      三、augular配置环境打包命令

        解决方法,直接上代码吧

        

     "configurations": {
                "production": {
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.prod.ts"
                    }
                  ],
                  "optimization": true,
                  "outputHashing": "all",
                  "sourceMap": false,
                  "extractCss": true,
                  "namedChunks": false,
                  "aot": true,
                  "extractLicenses": true,
                  "vendorChunk": false,
                  "buildOptimizer": true
                },
                "test": {
                "fileReplacements": [
                     {
                        "replace": "src/environments/environment.ts",
                        "with": "src/environments/environment.test.ts"
                      }
                    ],
                    "optimization": true,
                    "outputHashing": "all",
                    "sourceMap": false,
                    "extractCss": true,
                    "namedChunks": false,
                    "aot": true,
                    "extractLicenses": true,
                    "vendorChunk": false,
                    "buildOptimizer": true
                }
              }
            },
    

      研发环境打包命令:ng build

      测试环境打包命令:ng build --configuration=production

      正式环境打包命令:ng build --configuration=test

  • 相关阅读:
    freeswitch 对接IMS
    freeswitch对接北京移动IMS
    多台 FreeSWITCH 服务器级联
    FreeSWITCH代码分析
    软交换freeswitch系统概要和源代码分析初步
    SQL*Net message from client
    FreeSwitch下配置DID的方法
    FreeSWITCH实现多人来电思路
    SIP开源项目opensip,Freeswitch
    运行 FreeSWITCH
  • 原文地址:https://www.cnblogs.com/sun-web/p/9678934.html
Copyright © 2020-2023  润新知