在现代的前端开发过程中,source map是非常常见的,无论是babel转码、还是webpack打包,或者typescript编译,都会生成一份.map文件,就是我们说的source map文件。
首先,在Chrome等浏览器的devtools中可以看到源代码,说明根据.map肯定是能还原源代码的。不过浏览器只提供了单个文件的方式,对于想在工程级别还原整个代码的需求,还是不太方便。
下面我们通过分析一些现有的工具,一步步解析这个过程。
MIT License | |
Copyright © 2019 Andrés Zorro | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
使用 GVM 安装不同版本的 Go。碰到问题是国内无法访问 GVM 配置的源地址。报如下错误:
[root@mq:/home/wwwroot/]
$ gvm install go1.8
Downloading Go source...
Installing go1.8...
* Compiling...
ERROR: Couldn't download Go source. Check the logs /root/.gvm/logs/go-download.log
$ cat /root/.gvm/logs/go-download.log
// Must install ImageMagick first | |
http://www.imagemagick.org/script/index.php | |
//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg | |
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg | |
// This does the same as above but to an entire folder (will overwrite original files): | |
mogrify -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% *.jpg | |
//This does the same thing but to all subfolders as well (Be careful with this one it will overwrite all original files) |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |