angular - VSCode 未绑定断点
问题描述
我尝试了所有这些解决方案Unbound breakpoint - VS Code | 铬 | 有角度但都失败了。我还能尝试什么。我只想逐行调试我的代码。
我的项目
├── .vscode
│ ├── extensions.json
│ ├── launch.json
│ └── settings.json
├── 源
│ ├── 应用
│ ├── 资产
│ ├── 环境
│ └── 款式
└── angular.json
启动.json
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceRoot}",
"sourceMaps": true
}
]
}
角.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"myproject": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"spec": false,
"flat": false,
"inlineStyle": true,
"inlineTemplate": false,
"style": "less"
},
"@schematics/angular:application": {
"strict": true
},
"ng-alain:module": {
"routing": true,
"spec": false
},
"ng-alain:list": {
"spec": false
},
"ng-alain:edit": {
"spec": false,
"modal": true
},
"ng-alain:view": {
"spec": false,
"modal": true
},
"ng-alain:curd": {
"spec": false
},
"@schematics/angular:module": {
"routing": true,
"spec": false
},
"@schematics/angular:directive": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/myproject",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json",
{
"glob": "**/*",
"input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
"output": "/assets/"
}
],
"styles": [
"node_modules/ng-zorro-antd/ng-zorro-antd.min.css",
"src/styles.less"
],
"scripts": [],
"allowedCommonJsDependencies": [
"@antv/g2",
"ajv",
"ajv-formats",
"date-fns",
"file-saver"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all",
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "3mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"qas": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.qas.ts"
}
],
"outputHashing": "all",
"namedChunks": false,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "myproject:build",
"proxyConfig": "proxy/proxy.conf.json",
"disableHostCheck": true,
"host": "0.0.0.0",
"port": 4290,
"open": true
},
"configurations": {
"production": {
"browserTarget": "myproject:build:production"
},
"qas": {
"browserTarget": "myproject:build:qas"
},
"development": {
"browserTarget": "myproject:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "myproject:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json"
],
"styles": [
"src/styles.less"
],
"scripts": []
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "myproject:serve"
},
"configurations": {
"production": {
"devServerTarget": "myproject:serve:production"
}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"defaultProject": "myproject"
}
解决方案
我知道了 !我将以下代码添加到我的angular.json
文件中。
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
角.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"myproject": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"spec": false,
"flat": false,
"inlineStyle": true,
"inlineTemplate": false,
"style": "less"
},
"@schematics/angular:application": {
"strict": true
},
"ng-alain:module": {
"routing": true,
"spec": false
},
"ng-alain:list": {
"spec": false
},
"ng-alain:edit": {
"spec": false,
"modal": true
},
"ng-alain:view": {
"spec": false,
"modal": true
},
"ng-alain:curd": {
"spec": false
},
"@schematics/angular:module": {
"routing": true,
"spec": false
},
"@schematics/angular:directive": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/myproject",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json",
{
"glob": "**/*",
"input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
"output": "/assets/"
}
],
"styles": [
"node_modules/ng-zorro-antd/ng-zorro-antd.min.css",
"src/styles.less"
],
"scripts": [],
"allowedCommonJsDependencies": [
"@antv/g2",
"ajv",
"ajv-formats",
"date-fns",
"file-saver"
],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all",
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "3mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"qas": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.qas.ts"
}
],
"outputHashing": "all",
"namedChunks": false,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "myproject:build",
"proxyConfig": "proxy/proxy.conf.json",
"disableHostCheck": true,
"host": "0.0.0.0",
"port": 4290,
"open": true
},
"configurations": {
"production": {
"browserTarget": "myproject:build:production"
},
"qas": {
"browserTarget": "myproject:build:qas"
},
"development": {
"browserTarget": "myproject:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "myproject:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json"
],
"styles": [
"src/styles.less"
],
"scripts": []
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "myproject:serve"
},
"configurations": {
"production": {
"devServerTarget": "myproject:serve:production"
}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"defaultProject": "myproject"
}
推荐阅读
- spring-security - Spring boot + OAuth2 资源服务器-如果@Preauthorize 不在令牌中但在应用程序数据库中单独维护,如何检查角色
- c# - C# 是否可以从后台进程的控制台应用程序发送 Toast / BalloonTip?
- android - Snapdragon 神经处理 - SNPE
- c++ - 如何使用 cout 输出枚举元素?
- android - Android Activity - OnStop() 触发器
- python-3.x - Python Dash 表实时更新:Interval 的任何替代方案?
- javascript - 仅添加静态字符串的共享的 AddThis url 更改
- java - Android 中 Bash 文件的 ASN1 编译问题
- asp.net - 在 asp.net 页面加载中下载弹出窗口不正确
- php - 找不到“etc”文件夹来更改 php.ini