How to Not Minify Source with webpack
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!
![I’m an Impostor]()
This is the hardest thing I've ever had to write, much less admit to myself. I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life. All of those feelings were very...
![Page Visibility API]()
One event that's always been lacking within the document is a signal for when the user is looking at a given tab, or another tab. When does the user switch off our site to look at something else? When do they come back?
![Translate Content with the Google Translate API and JavaScript]()
Note: For this tutorial, I'm using version1 of the Google Translate API. A newer REST-based version is available.
In an ideal world, all websites would have a feature that allowed the user to translate a website into their native language (or even more ideally, translation would be...
![Create a Quick MooTools Slideshow with Preloading Images]()
I've been creating a lot of slideshow posts lately. Why, you ask? Because they help me get chicks. A quick formula for you:
The following code snippet will show you how to create a simple slideshow with MooTools; the script will also...
You may also want to use
devtool: 'source-map'
to enable high-resolution source maps for your bundles. It will make debugging with browser devtools infinitely easier. (They recognize the source maps and will even allow breakpoint debugging while viewing the original source files!)I’ve inherited a project and am trying to figure out how to edit the config file to stop WebPack from bundling CSS completely.
I think the way is to create two separate files, one for dev and one for production building. Then attach them to package.json > scripts and launch individually for their intended purpose.