0

我正处于将我们现有的 Angular 应用程序迁移到使用 nx 作为构建框架的单一存储库的早期阶段。

迁移我的第一个应用程序后,我注意到位于样式目录中的 styles.scss 文件被复制为 .js 而不是 .css。

我终其一生都无法弄清楚为什么。

角.json:

{

      "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
      "version": 1,
      "newProjectRoot": "projects",
      "projects": {
        "LSApp": {
          "projectType": "application",
          "schematics": {},
          "root": "apps/LSApp",
          "sourceRoot": "apps/LSApp/src",
          "prefix": "LSApp",
          "architect": {
            "build": {
              "builder": "@angular-devkit/build-angular:browser",
              "options": {
                "outputPath": "dist/apps/LSApp",
                "index": "apps/LSApp/src/index.html",
                "main": "apps/LSApp/src/main.ts",
                "polyfills": "apps/LSApp/src/polyfills.ts",
                "tsConfig": "apps/LSApp/tsconfig.app.json",
                "assets": [
                  "apps/LSApp/src/favicon.ico",
                  "apps/LSApp/src/assets"
                ],
                "styles": [
                  "node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
                  "apps/LSApp/src/styles/material-theme.scss",
                  "apps/LSApp/src/styles/styles.scss",
                  "apps/LSApp/src/styles/index.scss",
                  "node_modules/font-awesome/css/font-awesome.min.css",
                  "node_modules/tachyons/css/tachyons.min.css",
                  "node_modules/vis/dist/vis.min.css",
                  "node_modules/tether-shepherd/dist/css/shepherd-theme-arrows.css",
                  "node_modules/tether-shepherd/dist/css/shepherd-theme-arrows-fix.css",
                  "node_modules/tether-shepherd/dist/css/shepherd-theme-arrows-plain-buttons.css",
                  "node_modules/tether-shepherd/dist/css/shepherd-theme-default.css",
                  "./node_modules/froala-editor/css/froala_editor.pkgd.min.css",
                  "./node_modules/froala-editor/css/froala_style.min.css"
                ],
                "scripts": []
              },
              "configurations": {
                "production": {
                  "fileReplacements": [
                    {
                      "replace": "apps/LSApp/src/environments/environment.ts",
                      "with": "apps/LSApp/src/environments/environment.prod.ts"
                    }
                  ],
                  "optimization": true,
                  "outputHashing": "all",
                  "sourceMap": false,
                  "extractCss": true,
                  "namedChunks": false,
                  "aot": true,
                  "extractLicenses": true,
                  "vendorChunk": false,
                  "buildOptimizer": true,
                  "budgets": [
                    {
                      "type": "initial",
                      "maximumWarning": "10mb",
                      "maximumError": "10mb"
                    }
                  ]
                }
              }
            },
            "serve": {
              "builder": "@angular-devkit/build-angular:dev-server",
              "options": {
                "browserTarget": "LSApp:build",
                "port": 3000
              },
              "configurations": {
                "production": {
                  "browserTarget": "LSApp:build:production"
                }
              }
            },
            "extract-i18n": {
              "builder": "@angular-devkit/build-angular:extract-i18n",
              "options": {
                "browserTarget": "LSApp:build"
              }
            },
            "lint": {
              "builder": "@angular-devkit/build-angular:tslint",
              "options": {
                "tsConfig": [
                  "apps/LSApp/tsconfig.app.json",
                  "apps/LSApp/tsconfig.spec.json"
                ],
                "exclude": [
                  "**/node_modules/**",
                  "!apps/LSApp/**"
                ]
              }
            },
            "test": {
              "builder": "@angular-devkit/build-angular:karma",
              "options": {
                "main": "apps/LSApp/src/test.ts",
                "tsConfig": "apps/LSApp/tsconfig.spec.json",
                "karmaConfig": "apps/LSApp/karma.conf.js",
                "polyfills": "apps/LSApp/src/polyfills.ts",
                "styles": [
                  "src/styles/styles.scss"
                ],
                "scripts": [],
                "assets": [
                  "src/favicon.ico",
                  "src/assets"
                ]
              }
            }
          }
        },
        "LSApp-e2e": {
          "root": "apps/LSApp-e2e/",
          "projectType": "application",
          "architect": {
            "e2e": {
              "builder": "@angular-devkit/build-angular:protractor",
              "options": {
                "protractorConfig": "apps/LSApp-e2e/protractor.conf.js",
                "devServerTarget": "LSApp:serve",
                "port": 3000
              },
              "configurations": {
                "production": {
                  "devServerTarget": "LSApp:serve:production"
                }
              }
            },
            "lint": {
              "builder": "@angular-devkit/build-angular:tslint",
              "options": {
                "tsConfig": "apps/LSApp-e2e/tsconfig.e2e.json",
                "exclude": [
                  "**/node_modules/**"
                ]
              }
            }
          }
        }
      },
      "cli": {
        "warnings": {
          "typescriptMismatch": false,
          "versionMismatch": false
        },
        "defaultCollection": "@nrwl/angular"
      },
      "defaultProject": "LSApp",
      "schematics": {
        "@nrwl/angular:application": {
          "unitTestRunner": "karma",
          "e2eTestRunner": "none"
        },
        "@nrwl/angular:library": {
          "unitTestRunner": "karma"
        },
        "schematics": {
          "@schematics/angular:component": {
            "styleext": "scss"
          }
        },
        "@nrwl/schematics:component": {
          "styleext": "scss"
        }
      }
    }

包.json

{
  "name": "lsapp",
  "version": "1.36.0",
  "scripts": {
    "test": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "build:prod": " node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build LSApp --prod",
    "clean:dist": "npm run rimraf -- dist",
    "rimraf": "rimraf",
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "affected:apps": "nx affected:apps",
    "affected:libs": "nx affected:libs",
    "affected:build": "nx affected:build",
    "affected:e2e": "nx affected:e2e",
    "affected:test": "nx affected:test",
    "affected:lint": "nx affected:lint",
    "affected:dep-graph": "nx affected:dep-graph",
    "affected": "nx affected",
    "format": "nx format:write",
    "format:write": "nx format:write",
    "format:check": "nx format:check",
    "update": "ng update @nrwl/workspace",
    "update:check": "ng update",
    "workspace-schematic": "nx workspace-schematic",
    "dep-graph": "nx dep-graph",
    "help": "nx help"
  },
  "private": true,
  "dependencies": {
    "@acl/datepicker": "~2.0.9",
    "@acl/grid": "^2.1.9",
    "@angular/animations": "^8.2.14",
    "@angular/cdk": "^8.0.1",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/material": "^8.0.1",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@angularclass/hmr": "^1.2.2",
    "@hos/ah-df-schematics": "^1.1.2",
    "@hos/design-factory": "~7.1.0",
    "@hos/hospitality": "^9.8.0",
    "@ng-bootstrap/ng-bootstrap": "~5.2.1",
    "@ng-select/ng-option-highlight": "~0.0.2",
    "@ng-select/ng-select": "~3.0.7",
    "@ngrx/effects": "^8.0.1",
    "@ngrx/router-store": "^8.0.1",
    "@ngrx/store": "^8.0.1",
    "@ngrx/store-devtools": "^8.0.1",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "@types/vis": "^4.21.17",
    "angular-2-local-storage": "~2.0.0",
    "angular-froala-wysiwyg": "^3.0.4",
    "angular-sortablejs": "^2.7.0",
    "autoprefixer": "^6.7.7",
    "bootstrap": "~4.3.1",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.6.9",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "messageformat": "^1.1.1",
    "moment": "~2.24.0",
    "moment-timezone": "^0.5.25",
    "ng2-validation": "^4.2.0",
    "ng5-slider": "~1.2.4",
    "ramda": "^0.24.1",
    "reflect-metadata": "^0.1.13",
    "reselect": "^3.0.1",
    "rxjs": "~6.4.0",
    "sortablejs": "^1.9.0",
    "tachyons": "^4.11.1",
    "tether-shepherd": "^1.8.1",
    "text-mask-addons": "^3.7.2",
    "tslib": "^1.9.0",
    "url-search-params-polyfill": "^6.0.0",
    "vis": "^4.21.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.0",
    "@angular/cli": "~8.3.19",
    "@angular/compiler-cli": "~8.2.14",
    "@angular/language-service": "~8.2.14",
    "@nrwl/angular": "^8.2.0",
    "@nrwl/cli": "^8.2.0",
    "@nrwl/workspace": "^8.2.0",
    "@types/google-libphonenumber": "^7.4.17",
    "@types/hammerjs": "^2.0.35",
    "@types/jasmine": "^2.8.16",
    "@types/node": "~8.9.4",
    "@types/selenium-webdriver": "^2.53.43",
    "@types/tapable": "^1.0.2",
    "@types/tether-shepherd": "^1.2.28",
    "@types/uglify-js": "^3.0.3",
    "angular2-template-loader": "^0.6.2",
    "codelyzer": "^5.0.0",
    "dotenv": "6.2.0",
    "find-root": "^1.1.0",
    "gh-pages": "^0.12.0",
    "jasmine": "^2.99.0",
    "jasmine-allure-reporter": "^1.0.2",
    "jasmine-core": "^2.99.1",
    "jasmine-marbles": "^0.3.0",
    "jasmine-spec-reporter": "^4.2.1",
    "jasmine-tfs-reporter": "^1.0.2",
    "jest": "^24.8.0",
    "jest-preset-angular": "^7.1.1",
    "jest-zone-patch": "^0.0.7",
    "jquery": "^3.4.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "^1.1.2",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "^1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-mocha-reporter": "^2.2.5",
    "karma-remap-coverage": "^0.1.5",
    "karma-spec-reporter": "^0.0.32",
    "node-sass": "^4.14.1",
    "optimize-js-plugin": "^0.0.4",
    "parse5": "^3.0.3",
    "prettier": "^1.15.3",
    "protractor": "^5.4.2",
    "request": "^2.86.0",
    "rimraf": "^2.6.3",
    "source-map": "^0.7.3",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "tslint-config-prettier": "^1.17.0",
    "typedoc": "^0.15.0",
    "typescript": "~3.4.3",
    "wallaby-webpack": "^3.9.15"
  }
}

任何帮助将不胜感激!

4

0 回答 0