NG-ZORRO開發環境搭建

1. 建立項目css

ng new jupiter-web                  //要花較長時間
npm install ng-zorro-antd --save    //安裝NG-ZORRO,系統提示使用最新版本

2. Idea 中安裝必要的開發插件,並打開項目html

3. 若是用GIT託管,增長.gitignore,忽略本地環境文件上傳,團隊成員clone代碼後:npm install便可node

.idea
.idea/*.xml
dist
node_modules
*.iml

4. 配置基於Node的運行環境,注意,要提早安裝node和在Idea中安裝插件。選擇Node.js,新增運行項目,好比:jupiter-web,增長npm run script,選擇命令:start便可。git

5. 修改運行商品:package.jsonweb

"start": "ng serve --preserve-symlinks --port=5004",

6. Cannot find module '@angular-devkit/core',增長配置:npm

"@angular-devkit/core": "0.0.29",
npm install     //安裝必要的依賴

7. Cannot read property 'config' of null,增長一個.angular-cli.json配置文件,大體內容以下:json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "mars-werb"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "prefix": "app",
      "styles": [
        "styles.css"
      ],
      "scripts": [],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "src/tsconfig.spec.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "e2e/tsconfig.e2e.json",
      "exclude": "**/node_modules/**"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "component": {}
  }
}
相關文章
相關標籤/搜索