我正在尝试调试我的aurelia应用程序,并且出于某种原因,我的应用程序包的源代码生成时内容为'undefined'。另一个奇怪的事情是,我所有已编译的js文件都有一个.map文件,除了所有aurelia库的包。
以下是一些configs / gulp片段,如果您需要更多详细信息,请告诉我(我正在运行所有内容的最新版本,只需运行npm update和jspm update):
ts.config
{
"compileOnSave": false,
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"sourceMap": true,
"target": "es5",
"module": "amd",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"lib": ["es2015", "dom"],
"baseUrl": "./",
"paths": {
"src/*": ["src/*"]
}
},
"filesGlob": [
"./src/**/*.ts",
"./test/**/*.ts",
"./typings/index.d.ts",
"./custom_typings/**/*.d.ts",
"./jspm_packages/**/*.d.ts"
],
"exclude": [
"node_modules",
"jspm_packages",
"dist",
"build"
],
"atom": {
"rewriteTsconfig": false
}
}
bundles.js
module.exports = {
"bundles": {
"dist/app-build": {
"includes": [
"[**/*.js]",
"**/*.html!text",
"**/*.css!text"
],
"options": {
"sourceMaps": 'inline',
"inject": true,
"minify": true,
"depCache": true,
"rev": true
}
},
"dist/aurelia": {
"includes": [
"aurelia-framework",
"aurelia-dialog",
"aurelia-api",
"aurelia-authentication",
"aurelia-bootstrapper",
"aurelia-fetch-client",
"aurelia-router",
"aurelia-animator-css",
"aurelia-templating-binding",
"aurelia-polyfills",
"aurelia-templating-resources",
"aurelia-templating-router",
"aurelia-loader-default",
"aurelia-history-browser",
"aurelia-logging-console",
"isomorphic-fetch",
"polymer/mutationobservers",
"moment",
"numeral",
"servicestack-client",
"bootstrap",
"bootstrap/css/bootstrap.min.css!text",
"bootstrap/css/bootstrap-theme.min.css!text",
"jquery",
"text",
"core-js"
],
"options": {
"inject": true,
"minify": true,
"depCache": false,
"rev": true
}
}
}
};
build.js
var typescriptCompiler = typescriptCompiler || null;
gulp.task('build-system', function() {
if(!typescriptCompiler) {
typescriptCompiler = typescript.createProject('tsconfig.json', {
"typescript": require('typescript')
});
}
return gulp.src(paths.dtsSrc.concat(paths.source))
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
.pipe(changed(paths.output, {extension: '.ts'}))
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(gulpif(common.serverNameOverrideCondition, replace(args.uriRegex, args.productionServerName)))
.pipe(typescriptCompiler())
.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '/src' }).on('error', gutil.log))
.pipe(gulp.dest(paths.output));
});
任何帮助都会受到赞赏,比如我该怎么调试呢?