Top Links You Must Click On
From the Blogosphere
By: Trevor Parsons
Dec. 10, 2014 09:00 AM
This article by Ilya Biryukov was originally published on the Logentries Blog.
What are source maps?
It's generally a good practice to minify and combine your assets (JS & CSS) when deploying to production. This process reduces the size of your assets and dramatically improves your website's load time.
Source maps create a map from these compressed asset files back to the source files.
This map allows you to debug and view the source code of your compressed assets, as if you were actually working with the originals.
To install Uglify JS with NPM:
Minify the files and generate source maps:
The code above tells UglifyJS to:
Marrying source maps and Django Compressor
Behind the scenes you can develop logic to combine and minify the files with any algorithm or third party tools of your choosing.
Now, each compressed asset file contains a link pointing to its source map, and we've just told Chrome not to ignore them.
Pretty cool, huh?
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
SYS-CON Featured Whitepapers
Most Read This Week