简体   繁体   中英

How do I get Chrome Dev Tools to allow me to edit minified JavaScript in production?

I need to test a fix, and only production data is failing (and a tangled nest of foreign keys prevent copying data down to test).

The JavaScript fix is simple, 2 or 3 lines to section_functions.min.js.

I open dev tools, click the sources tab, drill down to the file... edit it. I do a cntl+s, the star disappears from the file's tab in Dev Tools.

I then use the web app's interface in such a way that the altered function in that file should be invoked...

But in the console, I get my same error as before and it's telling me the exception is on /js/section_functions.min.js (old):1 .

I know that it's possible to edit the javascript live in this fashion, and I must be doing something boneheaded that is preventing it from using the modified version. What am I failing to do correctly?

there is a usefull trick, add a sourcemap to your compressed js file so you can see and edit the code in beauty way.

other way faster to it is using the {} buton in the chrome tools it is in the bottom of the file in the left of line and column number

when you have it looking good you can edit it.

Good luck

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM