1.What is sourcemap?
A sourcemap is a file which contains the mapping between the minified(concated, uglified) file and the original files.
2.Why sourcemap?
If you want to keep your client side code readable and easy to debug after compressing, sourcemap will play tricks.
3.How to use sourcemap?
1.Enable sourcemap in chrome dev tools.
2.Generate sourcemap by using gulp(or grunt or whatever tools you like)
here is a sample configuration of Gulpjs.
1 | var gulp = require('gulp'); |