Have actually you ever discovered yourself wishing you might keep your client-side rule readable and much more importantly debuggable even with you have combined and minified it, without impacting performance? Well you will through the miracle of supply maps.
You generate a source map which holds information about your original files when you build for production, along with minifying and combining your JavaScript files. You can do a lookup in the source map which returns the original location when you query a certain line and column number in your generated JavaScript. Developer tools (presently WebKit nightly builds, Bing Chrome, or Firefox 23+) can parse the foundation map immediately and work out it appear as if you are operating unminified and files that are uncombined.
The aforementioned demo lets you right simply simply simply click any place in the textarea containing the source that is generated. Choose “Get initial location” will query the origin map by moving in the generated line and line number, and get back the position when you look at the initial rule. Ensure that your system is available so you can observe the output.
Real life
Before you see listed here world that is real of supply Maps ensure you’ve enabled the foundation maps function in either Chrome Canary or WebKit nightly by pressing the settings cog when you look at the dev tools panel and checking the “Enable supply maps” choice. See screenshot below.
Firefox 23+ has source maps enabled by default into the built in dev tools. See screenshot below. Read More