sentry-cli 上傳 sourcemap
Source map就是一個資訊檔案,裡面儲存著位置資訊。也就是說,轉換後的程式碼的每一個位置,所對應的轉換前的位置。
有了它,出錯的時候,除錯工具將直接顯示原始程式碼,而不是轉換後的程式碼。這無疑給開發者帶來了很大方便。
1,安裝sentry-cli
# npm install -g sentry-cli
2,sentry服務端找到token
直接方式,http://sentry.xxxx.com/api/,下面有token
也可以在主頁面的下方去找,不是在左下導行,就在右下。
3,sentry-cli登入
# sentry-cli --url http://sentry.xxxxx.com/ login This helps you signing in your sentry-cli with an authentication token. If you do not yet have a token ready we can bring up a browser for you to create a token now. Sentry server: sentry.xxxxx.com Open browser now? [y/n] n Enter your token: Enter your token: f6*************************b1 Valid token for user [email protected] Stored token in /root/.sentryclirc
4,上傳sourcemap
# sentry-cli releases -o myterm -p electron files [email protected] upload-sourcemaps /home/test/map > Analyzing 10 sources > Adding source map references > Uploading source maps for release [email protected] Source Map Upload Report Minified Scripts ~/index.js (sourcemap at index.js.map) ~/playback.js (sourcemap at playback.js.map) ~/ppt.js (sourcemap at ppt.js.map) ~/tindex.js (sourcemap at tindex.js.map) ~/tindexv5.js (sourcemap at tindexv5.js.map) Source Maps ~/index.js.map ~/playback.js.map ~/ppt.js.map ~/tindex.js.map ~/tindexv5.js.map
如果報413錯誤,配置nginx.conf在http中加上
client_max_body_size 50m;