0

In my angular.json I see sourceRoot as a project level property with value "src". However I also have a couple of file located below sourceRoot (of the kind "src/...", like in fileReplacements, index, main). Now I want to change sourceRoot for some reason and so I also have to change the mentioned file locations to adopt to the sourceRoot. I was wondering if it is not possible put a reference where ever former src/ directory occurs?

EDIT:

In my situation I have below excerpt in my angular.json file. The property sourceRoot is currently pointing to src directory. The src directory also appears in several other properties. I am asking if there is a way to use a reference to the configured sourceRoot directory instead of "hard-coding" "src/" as a value.

   { /* angular.json */
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "msal-angular-tutorial": {
      "projectType": "application",
      "schematics": {},
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/msal-angular-tutorial",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/pink-bluegrey.css",
              "src/styles.css",
              "./node_modules/survey-angular/modern.min.css",
              "node_modules/survey-angular/modern.css"
            ],
            "scripts": []
          }, /* SNIP */
Matthias
  • 3,458
  • 4
  • 27
  • 46

0 Answers0