How to Not Minify Source with webpack

C

codeguru

Member
Freecoin
282
The webpack JavaScript utility has taken over the modern JavaScript landscape, so much so that it’s hard to be a JavaScript developer and not use it. JavaScript build utilities are the point where they do best practices implicitly, like minify code, caching, and more.

I was recently debugging a bundled webpack app and it quickly became clear that the only way forward was debugging the actual source, not the minified code. Duh.y

To prevent webpack from minifying the source, add the following to your webpack config:

{
// .... other webpack, like output, etc.
optimization: {
minimize: false
},
}


This simple flag makes debugging easier, if only enabled for a moment. I love how webpack allows you to take advantage of its feature set while being able to disable really quickly!

The post How to Not Minify Source with webpack appeared first on David Walsh Blog.



Continue reading...
 

Richest Freecoded User

Most Freecoin

freecoded
freecoded
4,878 Freecoin
S
Smith16
653 Freecoin
J
Johnhendrick
645 Freecoin
Davy200
Davy200
590 Freecoin
nathan69
nathan69
426 Freecoin
Laureine
Laureine
415 Freecoin
A
anajeen
395 Freecoin
P
Peterparker87
386 Freecoin
C
codeguru
282 Freecoin
Tekera
Tekera
267 Freecoin
Top