- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
当我调用时,我可以将咖啡文件编译为与 .coffee/.js 文件位于同一目录中的 .map 文件
coffee --nodejs --debug-brk app.coffee
并启动 Node 检查器。应用程序文件的 js 版本在 chrome 中加载。我错过了什么??
这就是 chrome 为 three.coffee 文件显示的内容 ..
(function (exports, require, module, __filename, __dirname) { // Generated by CoffeeScript 1.6.2
(function() {
app.get('/three', function(req, res) {
debugger; return res.send('three/teedde');
});
}).call(this);
/*
//@ sourceMappingURL=three.map
*/
});
谢谢
最佳答案
您是在询问 Node 检查器,因为您说您正在启动它?您的问题似乎是在询问 Chrome 开发工具。请澄清。
npm (0.2.0beta4) 中的node-inspector 当前版本不支持source maps。
即使 issue已关闭,我在 github 上找不到任何可以启用此功能的内容(例如,请参阅 https://github.com/dannycoates/node-inspector/blob/update-ui/lib/session2.js#L123-L131 ,scriptParsed 事件没有 sourceMapURL 参数)。
node-inspector 已被一位新开发人员接管,根据评论(由 Vitaliy Lebedev 撰写),最新版本确实支持源映射。
如果您询问 Chrome 开发工具 - they support source maps .
在 js 文件的最后一行尝试“//@ sourceMappingURL=three.map”。
还要确保您的 express 应用实际上正在提供调试器所需的 .map 和 .coffee 文件(通过在浏览器中输入 url+文件名进行检查)。
关于node.js - coffeescript sourcemap 未在 chrome 中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15801143/
我是一名优秀的程序员,十分优秀!