How to Not Minify Source with webpack

C

codeguru

Member
Freecoin
295
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
2,180 Freecoin
Davy200
Davy200
590 Freecoin
nathan69
nathan69
424 Freecoin
Laureine
Laureine
415 Freecoin
C
codeguru
295 Freecoin
Tekera
Tekera
263 Freecoin
A
Akubay
170 Freecoin
smitha
smitha
104 Freecoin
G
Gabby
93 Freecoin
S
sesli
78 Freecoin
Top