未定义与Sourcemaps绑定的Aurelia
我正在尝试调试我的aurelia应用程序,由于某些原因,正在生成我的应用程序包的sourcemap,其内容为“未定义”。另一件奇怪的事情是,除了所有aurelia库的包之外,我所有传输的js文件都有一个.map文件 下面是一些configs/gulp代码片段,如果您需要更多详细信息,请告诉我(我正在运行最新版本的everything,只运行了npm更新和jspm更新): ts.config未定义与Sourcemaps绑定的Aurelia,aurelia,Aurelia,我正在尝试调试我的aurelia应用程序,由于某些原因,正在生成我的应用程序包的sourcemap,其内容为“未定义”。另一件奇怪的事情是,除了所有aurelia库的包之外,我所有传输的js文件都有一个.map文件 下面是一些configs/gulp代码片段,如果您需要更多详细信息,请告诉我(我正在运行最新版本的everything,只运行了npm更新和jspm更新): ts.config { "compileOnSave": false, "compilerOptions": {
{
"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));
});
var-typescriptCompiler=typescriptCompiler | | null;
吞咽任务('build-system',function()){
如果(!typescriptCompiler){
typescriptCompiler=typescript.createProject('tsconfig.json'{
“typescript”:需要('typescript')
});
}
return gulp.src(path.dtsSrc.concat(path.source))
.pipe(水管工({errorHandler:notify.onError('Error:')}))
.pipe(已更改(paths.output,{扩展名:'.ts'}))
.pipe(sourcemaps.init({loadMaps:true}))
.pipe(gulpif(common.servername覆盖条件,替换(args.uriRegex,args.productionServerName)))
.pipe(typescriptCompiler())
.pipe(sourcemaps.write('.',{includeContent:false,sourceRoot:'/src'}).on('error',gutil.log))
.pipe(吞咽目标(路径输出));
});
如有任何帮助,如我如何调试此功能,将不胜感激。问题不在于选项:“sourceMaps”:“inline”吗?请检查我是否删除了那一行,我得到了一堆错误:Error:EPERM:operation not allowed,statAlso,尽管有内联语句,我仍然为捆绑包中的所有typescript文件生成了有效的映射文件,而捆绑包本身得到了一个映射文件,它只包含一个词:undefined,底部似乎有两个条目,一个是内联编码的sourcemap(//#sourceMappingURL=data:application/json;base64,…),另一个条目指向一个文件://#sourceMappingURL=app-build-019e5c2865.js.map。当我查看较旧的构建(在我进行更新之前)时,我注意到它没有第二个文件映射。我怀疑这就是问题所在,我如何阻止它被放入?作为一个测试,我手动删除了第二个条目,它实际上解决了chrome查找“未定义”源地图的问题。现在的问题是,sourcemap包含传输的javascript,而不是原始的typescript(与以前一样)。你知道我该怎么做吗:a)停止错误的额外源地图url。b) 源映射是否包含原始类型脚本?问题不在于选项:“sourceMaps”:“inline”吗?请检查我是否删除了那一行,我得到了一堆错误:Error:EPERM:operation not allowed,statAlso,尽管有内联语句,我仍然为捆绑包中的所有typescript文件生成了有效的映射文件,而捆绑包本身得到了一个映射文件,它只包含一个词:undefined,底部似乎有两个条目,一个是内联编码的sourcemap(//#sourceMappingURL=data:application/json;base64,…),另一个条目指向一个文件://#sourceMappingURL=app-build-019e5c2865.js.map。当我查看较旧的构建(在我进行更新之前)时,我注意到它没有第二个文件映射。我怀疑这就是问题所在,我如何阻止它被放入?作为一个测试,我手动删除了第二个条目,它实际上解决了chrome查找“未定义”源地图的问题。现在的问题是,sourcemap包含传输的javascript,而不是原始的typescript(与以前一样)。你知道我该怎么做吗:a)停止错误的额外源地图url。b) 源映射是否包含原始类型脚本?