An Easy to Understand Webpack 4+ Configuration File with Comments

“Man wearing headphones at desk with window view of sunset in background” by Simon Abrams on Unsplash

Configuring Webpack could be a challenging and daunting task for most of us but if you spend sometime researching, reading and watching about the subject, it gets clearer.

Webpack team works hard to make the initial on boarding as easy as possible. Unfortunately, all serious apps requires in-depth configuration. Below you will find my version of Webpack configuration with comments added for each module/loader.

Hope it helps you in your projects.

Also don’t forget to checkout the resources below that helped me in my project.

Survive.js Webpack Book

Webpack 4 Tutorial: from 0 Conf to Production Mode

Webpack Configurator

webpack.config.js &

You may also visit these two files on Gist by clicking here