Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there SourceMaps for HTML?

Tags:

In Google Chrome there are already sourcemaps for JS and CSS, CoffeeScript etc., and Paul Irish just demostrated SASS using sourcemaps.

It is a a technique to map development source files to the compiled results in the browser to allow navigating back to the source.

So, is there sourcemaps for HTML now? Languages like Jade, Slim really want such features so that people may debug them more easily.

like image 533
jiyinyiyong Avatar asked May 22 '13 09:05

jiyinyiyong


People also ask

Should I use Sourcemaps production?

They are particularly useful for you and your team because they help tremendously for debugging issues as well as day-to-day work. I'm sure I make use of them just about every day. I'd say in general, they are used for local development.

What are Sourcemaps used for?

A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.

How do I enable Sourcemaps in Chrome?

To enable source maps in Google Chrome, go to Developer Tools, click the little cog icon, and then make sure that “Enable Javascript source maps” is checked. That's it.


2 Answers

Sourcemaps, ready to use for HTML today no. This is also something very complex to implement.

This can change in future. If this response was marked as correct, and someone knows after some time that my answer is not more true, please comment below I'm wrong.

like image 165
Emerson Rocha Avatar answered Sep 23 '22 17:09

Emerson Rocha


It is dead simnple to generate sourcemaps in a generic way like for css, but there is no browser support for it.

Some editors have plugins to support this. But be aware: this works best for static pages. (pug/jade, ... - using this at our place with nodejs+gulp)

like image 43
BananaAcid Avatar answered Sep 23 '22 17:09

BananaAcid