DEV Community

Discussion on: How to setup Webpack and Babel for React

Collapse
 
mikehale profile image
Mike Hale

It's not mentioned above, but if you use the sass option you need to change the css import in app.js to:

import './styles/styles.scss'

Collapse
 
iamismile profile image
Ismile Hossain

Thanks๐Ÿ™‚

Collapse
 
lordliquid profile image
Robert Cutright • Edited

Thanks for the helpful tutorial!

If you are doing this tutorial around time of this comment you may experience an error similar:

Error: Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:

  • C:\Projects\react-setup-tutorial\node_modules\webpack-dev-server\bin\webpack-dev-server.js

My Working Solution:

In your 'package.json' -

change:
"dev-server": "webpack-dev-server"

to:
"dev-server": "webpack serve"

Thread Thread
 
iamismile profile image
Ismile Hossain

Thank you๐Ÿ™‚