Skip to content

Instantly share code, notes, and snippets.

@jackcallister
Created July 11, 2020 21:39
Show Gist options
  • Save jackcallister/f8e3693676d789df692a693430dc8384 to your computer and use it in GitHub Desktop.
Save jackcallister/f8e3693676d789df692a693430dc8384 to your computer and use it in GitHub Desktop.
React Webpack Babel Minimal Setup (2020)
{
"presets": ["@babel/preset-react", "@babel/preset-env"]
}
$ npm i --save-dev @babel/cli @babel/core @babel/polyfill @babel/preset-env @babel/preset-react babel-loader webpack webpack-cli
$ npm i --save react react-dom
const path = require('path');
module.exports = {
mode: 'development',
entry: './index.jsx',
output: {
filename: 'lib.js',
path: path.resolve(__dirname),
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment