Use devtool of [the] webpack

Our code is usually the converted es6 into es5, all the time is being given location es5 where the code, the line number is wrong, then so unreasonable, set by devtoll

 

Use in a development environment (do not use online this way, you will be exposed to the source code)

devtool: 'source-map'

It shows the original source code

 

Use the online environment

devtool: 'cheap-source-map'

Displaying the converted codes

 

Two options above will generate a separate mapping file .map

 

If you do not want this configuration, the reference here: https://www.webpackjs.com/configuration/devtool/

 

We generally like configuration

 

Guess you like

Origin www.cnblogs.com/wuxianqiang/p/11330982.html