React App with Webpack & Babel (ES6+, source maps, hot reload, and more)

preview_player
Показать описание
In this tutorial, we will set up a React project from the ground up using popular tooling including Webpack and Babel. By the end of this video, you will understand the basic inner workings of boilerplate libraries such as create-react-app, and will learn to scaffold a development environment for your own apps.

Note that I decided to go with Babel 6, since v7 is still in beta; in fact, they just authored a breaking change in 7.0.0-beta.52 the other day!

FAQ

- Why do we need a module bundler like Webpack?

Because some people still use older browsers that don't support ES6 modules (e.g. IE11), and because HTTP/2 is yet to fully replace HTTP 1.1.

- Why do we need a transpiler like Babel?

For cross-browser support, because older browsers don't support ES6+ features natively.

- Why do we need a source map?

Because it's very hard to debug minified, uglified, and transpiled code. To fix a bug in production, you need to trace it back to its original source.

- Why not create-react-app?

If you need to change a small setting, are you comfortable ejecting and sifting through its 100s LOC config? It's worthwhile to bootstrap the workspace yourself so you can tailor it towards your app.

TODO

In a future video, I could cover polyfills, linting, testing, code coverage, and version control. Topic requests are welcome. Thanks!
Рекомендации по теме
Комментарии
Автор

Such a powerful thing and well explained, I'm surprised it's so little views((

andriiauziak
Автор

Very good explanation. All answers of my questions are cleared here!!! (Y)

imranyaseen
Автор

As always you nailed it Alex, good work!

aikidoshi
Автор

thank you. really like the UI animations. well done

junka
Автор

Thank you for this awesome video, I am waiting for mern stack video

AbhishekKumar-mqtt
Автор

Now when released 8 version of babel-loader this doesn't work.
For this thing to work, need to be installed 7.1.5 version.
7:40

andriiauziak
Автор

Thanks Alex!
All your videos are very useful for the learning stage I am in, recently starting to work in a more professional way!
Assuming you work in the field, what other technologies do you use?
Do you have any Typescript experience? Any backend? (Java, Go, etc)

Im interested in improve functional programming and algorithm skills cause i never learned anything of this. Do you recommend any book or online course?
Thank you so much, keep going!

mmr
Автор

this needs an update, perhaps add config for production, development and common

lightningresaba