DEV Community

Discussion on: How to configure Webpack 4 or 5 from scratch for a basic website

Collapse
 
andfinally profile image
And Finally • Edited

Great tutorial, thanks Anton! It would really help if you could let us see your full webpack.config.js though. I'm getting a weird error TypeError: this.getOptions is not a function from sass-loader. I'm pretty sure it's because something's in the wrong place in my config.

My problem was due to package versions. On npm install I was getting these warnings:

npm WARN postcss-loader@5.0.0 requires a peer of webpack@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@11.0.0 requires a peer of webpack@^5.0.0 but none is installed. You must install peer dependencies yourself.
Enter fullscreen mode Exit fullscreen mode

Installing webpack 5.0.0 made them go away and got the build running correctly.

 npm install --save-dev "webpack@^5.0.0"
Enter fullscreen mode Exit fullscreen mode