node.js - Debug CoffeeScript sources with node-inspector -


i'm using coffeescript while write node.js programs. it's ok debug node-inspector if compile sources source maps.

however, when try create mixed javascript/coffeescript app using coffee-script/register:

#!/usr/bin/env node require('coffee-script/register'); require('../src/client'); 

then, node-inspector shows compiled javascript.

is there how see actual *.coffee sources in node-inspector when i'm not explicity compiling it?

disclaimer: maintainer of node inspector

in order see actual *.coffee file in node inspector, need provide source-map file describing how map transpiled javascript loaded inside node/v8 runtime coffee-script source. additionally, filename of transpiled javascript must different original script name (afaik).

this trouble require('coffee-script/register'): converts coffee-script source javascript source while keeping same file name. in other words, runtime (and node inspector) see *.coffee contain transpiled javascript, cannot display coffee script same filename. afaik, coffee compiler not emit source map in case.

i see 2 possible approaches fix problem:

  1. modify loadfile() in coffee-script/register:

    • emit source map , save file
    • pass different filename module._compile, e.g. script.coffee.js
  2. modify coffee-script/register emit embedded source map. fix chrome devtools and/or node inspector support embedded source maps.

references:


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -