Skip to content

Instantly share code, notes, and snippets.

@CoughBall
CoughBall / webpack_template.config.js
Last active August 31, 2019 09:12
My webpack v4 configuration Template I use in my projects (without the comments). Summarized the majority and important parts from webpack v4 official documentation https://webpack.js.org/guides/getting-started/ with explanations and links to discussions from around the web
//https://webpack.js.org/concepts
//webpack requires nodejs to work
// to run webpack manualy and not through npm, with custom config file: "npx webpack --config webpack.config.js"
//how a chunk file is loaded (whether synchronously or asynchronously) is decided by Webpack and you can’t force it to do otherwise
//https://itnext.io/react-router-and-webpack-v4-code-splitting-using-splitchunksplugin-f0a48f110312#1adc
const path = require(`path`);
const HtmlWebpackPlugin = require (`html-webpack-plugin`);
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');