Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourceMappingURL and consolify #66

Closed
aboutlo opened this issue Jan 7, 2015 · 3 comments
Closed

sourceMappingURL and consolify #66

aboutlo opened this issue Jan 7, 2015 · 3 comments

Comments

@aboutlo
Copy link

aboutlo commented Jan 7, 2015

Hi there,

I'm using mochify and consolify options in a gulp project. Everything works like a charme expect sourceMappingURL missing on my runner.html generated by --consolify. Currently Mochify accepts a debug option but his meaning is not the same of Browserify.

So I dug in mochify source code and to me the browserify debug options seems true as default so dunno why sourceMappingURL is missing. I would like debug my tests sometimes in a browser.

My mochify.js:

gulp.task('mochify', function () {
  mochify( config.test, {
    reporter : 'spec',
    debug: true,
    //cover    : true,
    consolify : 'runner.html'
  }).bundle();
});

Have you any workaround?
cheers Lorenzo

@mantoni
Copy link
Owner

mantoni commented Jan 7, 2015

The source maps are generated and used to map stack traces back to the original sources. However, the original source maps need an additional offset to work properly, because the source lives inline in the html page.

Instead of having wrong source maps, I decided to not have source maps at all until a proper solution can be provided.

I can think of these solutions:

  • Modify the source maps to take the additional offset into account
  • Generate the bundle as a separate .js file which will then work properly with the source maps as they are

I cannot make any promises when I will have the time to look into this. Ideas / pull request welcome.

@aboutlo
Copy link
Author

aboutlo commented Jan 7, 2015

I guess the best solution is the first one but it seems more complex.
The second one is a workaround and it could be achieved even without mochify. Sounds to me a shame
So far I don't have enough know how about mochify and gulp internals but may be in the future ;)
Meanwhile thank you for you work!

@mantoni
Copy link
Owner

mantoni commented Apr 15, 2015

With Mochify 2.8.0, you can specify a separate --bundle my-bundled-script.js which includes the source maps. You can use this option for debugging now.

@mantoni mantoni closed this as completed Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants