Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel-loader presets #1

Closed
kbetts opened this issue Aug 10, 2018 · 2 comments
Closed

babel-loader presets #1

kbetts opened this issue Aug 10, 2018 · 2 comments

Comments

@kbetts
Copy link

kbetts commented Aug 10, 2018

I ran into an issue with the webpack build failing. It can be fixed by setting the "presets" option for babel-loader to react in the webpack.config.js file.

The issue is probably a nuance to my environment, although there is some background here and here. The preferred solution is to probably use a .babelrc config file as described here.

Original webpack.config.js file,

webpack_config_client_js_orig

Adding a "preset" option for babel-loader in the module.rules array solves the issue (although see the link above regarding the .babelrc config file solution),

webpack_config_client_js_fix

@shamahoque
Copy link
Owner

The code actually does have a .babelrc config file, as discussed in the book under Chapter 2: Preparing the Development Environment -> Checking your development setup -> Configuring Babel, Webpack, and Nodemon.

But I just saw that the .babelrc file is missing in the PacktPublishing/Full-Stack-React-Projects code repository. Thank you for pointing this out.

@kbetts
Copy link
Author

kbetts commented Aug 10, 2018

Thank you for following up so quickly. I had cloned the Packt repository. Build works perfectly after reverting the webpack.config.js file and added the .babelrc found here.

@kbetts kbetts closed this as completed Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants