DEV Community

Discussion on: Don't use create-react-app: How you can set up your own reactjs boilerplate.

Collapse
 
nikhilkumaran profile image
Nikhil Kumaran S

I'm glad you liked it ❤️

Do we really need the resolve (modules: ... alias:) block though?

It's not required for the example mentioned in this blog post. resolve is used to tell webpack how to resolve our imports(modules).
Eg: If you are using import 'pages/about/About'(instead of relative paths for cleaner syntax) you need to specify modules: [path.join(__dirname, 'src'), 'node_modules'] so webpack will first look for pages folder inside src. If you don't specify modules then webpack by default will check in the node_modules and throw this error Module not found: Error: Can't resolve 'pages/about/About'.