├── .babelrc ├── .gitignore ├── README.md ├── package.json ├── src ├── index.html ├── index.js └── style.css └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { "presets": ["@babel/preset-env", "@babel/preset-react"] } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | package-lock.json 4 | yarn.lock -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react_webpack_babel 2 | Simple and maintainable skeleton for npm react webpack projects 3 | 4 | This project is an alternative to `npx create-react-app`. The advantage is that all the webpack and babel setting are specified explicitly rather than hidden away in `react-scripts`. This way, it is easier to understated and modify. 5 | 6 | This project is based on https://blog.usejournal.com/setting-up-react-webpack-4-babel-7-from-scratch-2019-b771dca2f637 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react_webpack_babel", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "webpack-dev-server --open --hot --mode development", 9 | "build": "webpack --mode production" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "devDependencies": { 15 | "@babel/core": "^7.5.0", 16 | "@babel/preset-env": "^7.5.0", 17 | "@babel/preset-react": "^7.0.0", 18 | "babel-loader": "^8.0.6", 19 | "css-loader": "^3.0.0", 20 | "html-loader": "^0.5.5", 21 | "html-webpack-plugin": "^3.2.0", 22 | "react": "^16.8.6", 23 | "react-dom": "^16.8.6", 24 | "style-loader": "^0.23.1", 25 | "webpack": "^4.35.2", 26 | "webpack-cli": "^3.3.5", 27 | "webpack-dev-server": "^3.7.2" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |