由于最近升级到最新的angular-cli
and angular
,我不再在 Chrome 中看到 source-maps Karma debug runner
。
做了一些研究后,我发现了这个ng test --sourcemaps=true
选项,但这并没有什么区别,没有webpack://
像以前那样在 chrome 调试工具源选项卡中的文件夹。
ng -v
日志:
@angular/cli: 1.1.3
node: 6.9.4
os: win32 x64
@angular/animations: 4.2.4
@angular/common: 4.2.4
@angular/compiler: 4.2.4
@angular/core: 4.2.4
@angular/forms: 4.2.4
@angular/http: 4.2.4
@angular/platform-browser: 4.2.4
@angular/platform-browser-dynamic: 4.2.4
@angular/router: 4.2.4
@angular/cli: 1.1.3
@angular/compiler-cli: 4.2.4
@angular/language-service: 4.2.4
业力.conf:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
//require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
// coverageIstanbulReporter: {
// reports: ['html', 'lcovonly'],
// fixWebpackSourcePaths: true
// },
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
browsers: ['Chrome'],
logLevel: config.LOG_DEBUG,
autoWatch: true,
singleRun: false,
sourceMaps: true,
captureTimeout: 25000,
browserDisconnectTolerance: 3, //this one helps
browserDisconnectTimeout: 25000,
browserNoActivityTimeout: 25000,
skipFiles: [
"node_modules/**/*"
],
webRoot: "${workspaceRoot}"
});
};