无法在开发服务器的Chrome中调试打字稿文件

时间:2019-06-24 12:47:08

标签: angular typescript debugging webpack webpack-dev-server

当我通过ng serve作为localhost:4200在本地运行chrome上的打字稿时,我可以调试它,但是当我通过npm install将其部署到服务器上时,我看不到任何打字稿文件或组件如下。

我发现webpack.config.js中应该有一些配置,以便开发服务器可以在其上发布Webpack,但是我不确定它包含什么样的代码并在开发服务器上执行

这是我的package.json文件和通过chrome在本地和开发服务器上运行时的源代码视图

    {
      "name": "ng-vbu-digital-operations",
      "version": "0.0.0",
      "scripts": {
        "ng": "ng",
        "start": "ng serve --proxy-config proxy-conf.json",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
      },
      "private": true,
      "dependencies": {
        "@angular/animations": "~7.0.0",
        "@angular/common": "~7.0.0",
        "@angular/compiler": "~7.0.0",
        "@angular/core": "~7.0.0",
        "@angular/forms": "~7.0.0",
        "@angular/http": "~7.0.0",
        "@angular/platform-browser": "~7.0.0",
        "@angular/platform-browser-dynamic": "~7.0.0",
        "@angular/router": "~7.0.0",
        "@ngx-translate/core": "11.0.0",
        "@ngx-translate/http-loader": "4.0.0",
        "angular2-text-mask": "^9.0.0",
        "babel-polyfill": "^6.26.0",
        "core-js": "^2.5.4",
        "idempotent-babel-polyfill": "^7.0.0",
        "jquery": "^3.3.1",
        "ngx-owl-carousel": "^2.0.7",
        "rxjs": "6.3.3",
        "zone.js": "~0.8.26"
      },
      "devDependencies": {
        "@angular-devkit/build-angular": "^0.13.5",
        "@angular/cli": "~7.0.4",
        "@angular/compiler-cli": "^7.2.9",
        "@angular/language-service": "~7.0.0",
        "@types/jasmine": "~2.8.8",
        "@types/jasminewd2": "~2.0.3",
        "@types/jquery": "^3.3.29",
        "@types/node": "~8.9.4",
        "codelyzer": "~4.5.0",
        "jasmine-core": "~2.99.1",
        "jasmine-spec-reporter": "~4.2.1",
        "karma": "^4.0.1",
        "karma-chrome-launcher": "~2.2.0",
        "karma-coverage-istanbul-reporter": "~2.0.1",
        "karma-jasmine": "~1.1.2",
        "karma-jasmine-html-reporter": "^0.2.2",
        "protractor": "~5.4.0",
        "ts-node": "~7.0.0",
        "tslint": "~5.11.0",
        "typescript": "~3.1.1",
        "webpack-dev-server": "^3.7.2"
      },
      "projects": {
        "ng-vbu-digital-operations": {
          "root": "",
          "sourceRoot": "src",
          "projectType": "application",
          "prefix": "app",
          "schematics": {},
          "architect": {
            "build": {
              "builder": "@angular-devkit/build-angular:browser",
              "options": {
                "outputPath": "dist/ng-vbu-digital-operations",
                "index": "src/index.html",
                "main": "src/main.ts",
                "polyfills": "src/polyfills.ts",
                "tsConfig": "src/tsconfig.app.json",
                "assets": [
                  "src/favicon.ico",
                  "src/assets"
                ],
                "styles": [
                  "src/styles.css"
                ],
                "scripts": [
                  "node_modules/jquery/dist/jquery.min.js",
                  "./src/assets/scripts/vendor/ls.bgset.min.js",
                  "./src/assets/scripts/vendor/lazysizes.min.js",
                  "./src/assets/scripts/vendor/modernizr-custom.min.js",
                  "./src/assets/scripts/main.js",
                  "./src/assets/dist/owl.carousel.min.js"
                ]
              },
              "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,
                  "budgets": [
                    {
                      "type": "initial",
                      "maximumWarning": "2mb",
                      "maximumError": "5mb"
                    }
                  ]
                },
                "test": {
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.test.ts"
                    }
                  ]
                },
                "pprod": {
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.pprod.ts"
                    }
                  ],
                  "optimization": true,
                  "outputHashing": "all",
                  "sourceMap": false,
                  "extractCss": true,
                  "namedChunks": false,
                  "aot": true,
                  "extractLicenses": true,
                  "vendorChunk": false,
                  "buildOptimizer": true,
                  "budgets": [
                    {
                      "type": "initial",
                      "maximumWarning": "2mb",
                      "maximumError": "5mb"
                    }
                  ]
                }
              }
            },
            "serve": {
              "builder": "@angular-devkit/build-angular:dev-server",
              "options": {
                "browserTarget": "ng-vbu-digital-operations:build"
              },
              "configurations": {
                "production": {
                  "browserTarget": "ng-vbu-digital-operations:build:production"
                }
              }
            },
            "extract-i18n": {
              "builder": "@angular-devkit/build-angular:extract-i18n",
              "options": {
                "browserTarget": "ng-vbu-digital-operations:build"
              }
            },
            "test": {
              "builder": "@angular-devkit/build-angular:karma",
              "options": {
                "main": "src/test.ts",
                "polyfills": "src/polyfills.ts",
                "tsConfig": "src/tsconfig.spec.json",
                "karmaConfig": "src/karma.conf.js",
                "styles": [
                  "src/styles.css"
                ],
                "scripts": [],
                "assets": [
                  "src/favicon.ico",
                  "src/assets"
                ]
              }
            },
            "lint": {
              "builder": "@angular-devkit/build-angular:tslint",
              "options": {
                "tsConfig": [
                  "src/tsconfig.app.json",
                  "src/tsconfig.spec.json"
                ],
                "exclude": [
                  "**/node_modules/**"
                ]
              }
            }
          }
        },
        "ng-vbu-digital-operations-e2e": {
          "root": "e2e/",
          "projectType": "application",
          "prefix": "",
          "architect": {
            "e2e": {
              "builder": "@angular-devkit/build-angular:protractor",
              "options": {
                "protractorConfig": "e2e/protractor.conf.js",
                "devServerTarget": "ng-vbu-digital-operations:serve"
              },
              "configurations": {
                "production": {
                  "devServerTarget": "ng-vbu-digital-operations:serve:production"
                }
              }
            },
            "lint": {
              "builder": "@angular-devkit/build-angular:tslint",
              "options": {
                "tsConfig": "e2e/tsconfig.e2e.json",
                "exclude": [
                  "**/node_modules/**"
                ]
              }
            }
          }
        }
      }
    }

当我在开发服务器上运行它时,我看不到webpack,

如果我在本地运行,则可以对其进行调试

0 个答案:

没有答案