I have an ES6 module that is compiled using webpack. To debug it, I need to manually bind certain objects to window, so that I can reference them using the debugging tools in Chrome / Safari:
window
export class Dialog { ... } window.debugdialog = Dialog;
This is very cumbersome and certainly not the best way to do this. Is there a way to reference modules without having to change the source?
Yes, I know about breakpoints, and I use them. But sometimes I want to download all the code and customize the user interface, controlling it with built-in JavaScript.
, , JavaScript devtools, bundle.js ( ).
bundle.js
Sourcemaps , Chrome, Webpack.
Webpack , :
devtool: 'source-map'
(. )
, webpack cli, webpack -d , .
webpack
webpack -d
Chrome .
, , JavaScript . , sourcemap , .
Ctrl + P, .
, "" Ctrl + Shift + O, class .
class
Source: https://habr.com/ru/post/1629301/More articles:Swift: how to disable integer overflow / overflow traps for a function - swiftwhy is there only an account in the C # queue or list, but does the array have a length? - arraysPHPExcel, how to set a crash and expand for groups of strings? - phpAndroid application crash before requesting permissions - androidRoslyn with .net 4.5.2 - .net-4.5Datatables standalone data editor in Java Servlet - javaIs there a Javascript TCP Soket Library for PHP like SignalR with .NET? - phpChecking Yii2 Image Size - phpPHP date_format (): how to format a date from a string value - phpWhy doesn't a ReferenceError link occur if a variable is used before it is declared? - javascriptAll Articles