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

Upgrade to webpack4, babel7 #448

Open
lemonCMS opened this issue Jun 7, 2018 · 1 comment
Open

Upgrade to webpack4, babel7 #448

lemonCMS opened this issue Jun 7, 2018 · 1 comment

Comments

@lemonCMS
Copy link
Contributor

lemonCMS commented Jun 7, 2018

Hello Bertho,

I just want to share for who is wondering howto upgrade to webpack4 and babel 7. I spend a lot of hours over the past days struggling with react-hot-loader that was not working

Babel7

  • Upgrade is pretty straight on, just add the new namespaced packages en replace the requires with their namespaced ones. Take a look at the package.json and fix where problems arise.
  • Upgrade .babelrc
  • add polyfill to webpack configs

Webpack 4

react-loadable

  • Is currently not available for webpack 4, but there is a fork 7rulnik/react-loadable/webpack see issue
  • I put a resolve.alias in mij webpack configurations but there still some places you need to use the new package name.
  • Everey component that is load through react-loadable must be hot exported see: react-hot-loader

Eslint

  • eslint-config-airbnb does not play nice with the latest eslint packages. But the fix was simple i looked over at the source and now i extend with the separate rule files.
  • added the parser option ecmaversion: 2017 eslint requested

See full source over at https://github.com/lemonCMS/react-redux-universal-hot-example-1

I did not create a pull request because of the hacky stuff that went on to get it to work.


Happy Coding

@bertho-zero
Copy link
Owner

Thank you for your contribution, it's great!

You can see all the changes here: master...lemonCMS:master
There are many things that could serve me here.

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