1

操作系统:Windows 10

使用 Angular-CLI

dist我的最终目标是在运行后在文件夹中设置一个包含以下文件结构的包npm run packagr

+--src
|    +-- app
|    +-- assets

angular-cli.json根据文档做了以下设置:

"apps" : [
    {
         "root": "src",
         "outDir": "dist",
         "assets": [
             {
                 "glob": "**/*",
                 "input": "../styles",
                 "output" : "./assets/styles"
             }
         ], ...
     }, ...
]

根据文档,这应该针对assets/styles我的 src 目录中的文件夹,抓取其中的所有内容,然后将其作为副本发送到 dist。它不会那样做,我已经做了很多次迭代。我想要的只是 dist 目录中的样式文件夹,因此当我运行npm pack它时,它位于包中并准备好上传。

包.json

{
  "name": "c2c-component-library",
  "version": "0.0.3",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "packagr": "ng-packagr -p ng-package.json"
  },
  "private": false,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "bootstrap": "^4.0.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "1.6.8",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ng-packagr": "^2.0.0",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}
4

0 回答 0