Webpack 4 migration CommonsChunkPlugin

As of webpack v4 the CommonsChunkPlugin is deprecated. We have deprecated and removed CommonsChunkPlugin, and have replaced it with a set of defaults and easily overridable API called optimization.splitChunks. webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead. Deprecated You no longer need to use these plugins: DedupePlugin has been removed too in v4 NoEmitOnErrorsPlugin -> … Read more

Can’t import SVG into Next.js

You need to provide a webpack loader that will handle SVG imports, one of the famous one is svgr. In order to configure it to work with next, you need to add to your next.config.js file the usage of the loader, like that: // next.config.js module.exports = { webpack(config) { config.module.rules.push({ test: /\.svg$/, issuer: { … Read more