Build a starter app with React, Webpack and Babel in this React JS Tutorial for Beginners

preview_player
Показать описание

In previous tutorials we used Create-React-App to quickly setup our projects. However, in this React JS Tutorial for Beginners we learn how to setup our own React project using Webpack and Babel to transpile our ES6 Javascript into multi browser compatible javascript code. If you are a beginner, then this tutorial should help you learn the basics of using Webpack with Babel because this is a React JS Tutorial for Beginners.
Рекомендации по теме
Комментарии
Автор

I like your idea to have bare minimum of loaders for a starter app. This way you can add what you really need as you go along.
Few updates for webpack 4.
@babel/preset-es2015 is replaced with @babel/preset-env.
To make my react app work with the latest and greatest from webpack and babel, I made the following changes:
* imported webpack-cli in addition to webpack
* Placed all presets into .babelrc under the project root.
* Added html-webpack-plugin and html-loader to webpack.config.js.
* You no longer need require('path') and require('webpack') at the beginning of webpack.conig.js.

The bundle is now being placed into dist/main.js along with index.html

MrRight
Автор

your videos follows my npm install setup but its not working show in error -->[throw error] :(
:(

dkudeshnashah
Автор

test: /.jsx?$/, missing the back slash, should be: test: /\.jsx?$/,

SleazyNice