welldone-software / gulp-durandal

Gulp plugin for building durandaljs projects
MIT License
13 stars 19 forks source link

Source maps aren't right #19

Closed jdcrutchley closed 9 years ago

jdcrutchley commented 9 years ago

Could be I did something wrong, but I've tried several methods. Here's the simplest:

  1. Clone this repo.
  2. Copy the Html Starter Kit example directory to a temp directory.
  3. Modify gulpfile.js so durandal = require('gulp-durandal') instead of require('../../index').
  4. From temp directory, npm install gulp, gulp-durandal, gulp-rename, etc.
  5. Run gulp
  6. Browse to resultant index.html (simple version, not almond) using Chrome.

Results:

I can see the source files under app/views and app/viewmodels in Chrome's dev tools sources tab. The main.js file shown there shows the source for the concatenated file. Breakpoints don't seem to line up with where I put them. Sometimes I'll try to set a breakpoint for a line and it'll jump down a few lines and put a breakpoint there. When it does let me put one where I wanted, when I actually run the app it breaks somewhere else. It appears the generated source map isn't correct and is mapping the real code back to incorrect locations in the source.

Please tell me I've just done something wrong in my setup - though I've tried MANY different variations with consistent results.

jdcrutchley commented 9 years ago

Found the reason for this was in node: https://github.com/joyent/node/pull/25342.