-
npm init
in the project folder -
npm install webpack webpack-cli webpack-dev-server -g
-
npm install babel-loader @babel/core @babel/preset-env @babel/preset-react --save-dev
-
Create
webpack.config.js
in main folder:const path = require('path'); module.exports = { entry: './index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, module: { rules: [ { test: /\.jsx?$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env', '@babel/preset-react'] } }, }, ] }, mode: 'development' };
-
Take a break
-
index.html
should have<script src='dist/bundle.js'></script>
at the end of body -
Install
react
andreact-dom
usingnpm install react react-dom prop-types --save-dev
Last active
May 15, 2020 19:16
-
-
Save karansinghgit/a8dee1c62e03596061e5ae61f3b68c43 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment