How to Not Minify Source with webpack

Publikováno: 10.9.2019

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 […]

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

Celý článek

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.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace