-
mkdir react-0-1-build & cd react-0-1-build
-
touch README.md
-
npm init -y
-
git init & touch .gitignore & echo -e "/node_modules \nyarn.lock \npackage-lock.json \n/.git \n/dist" >> .gitignore
-
mkdir config & touch config/webpack.dev.config.js
-
mkdir src & touch src/index.js & echo -e "console.log('Hello webpack')" > src/index.js
-
mkdir public & touch public/index.html
-
git remote add origin https://github.com/zhuyuanmin/react-0-1-build.git
-
yarn add webpack webpack-cli -D
-
npx webpack --config ./config/webpack.dev.config.js
- yarn add @babel/core @babel/preset-env @babel/preset-react babel-loader @babel/plugin-transform-runtime @babel/plugin-proposal-class-properties -D
- touch .babelrc
- yarn add react-router-dom -S
- yarn add webpack-dev-server -D
- script: webpack serve --config ./config/webpack.dev.config.js
- yarn add redux react-redux redux-thunk -S
- yarn add html-webpack-plugin clean-webpack-plugin -D
- yarn add (style-loader) css-loader -D
- yarn add postcss-loader postcss-cssnext -D
- yarn add url-loader file-loader -D
- yarn add react-loadable -D
- yarn add mini-css-extract-plugin optimize-css-assets-webpack-plugin -D
- yarn add happypack webpack-bundle-analyzer -D
- yarn add react-svg -S
- yarn add webpack-merge -D
- yarn add ip os -D
- yarn add cross-env -D
- yarn add friendly-errors-webpack-plugin -D
- script: cross-env NODE_ENV=development webpack serve --config ./config/webpack.dev.config.js
- script: cross-env NODE_ENV=production webpack --config ./config/webpack.prod.config.js
- yarn add husky lint-staged
- npx husky install
- npx husky add .husky/pre-commit "npx lint-staged"
- yarn add eslint babel-eslint eslint-plugin-jsx-a11y eslint-plugin-react -D
- yarn add antd axios dayjs qs -S
- yarn add less less-loader -D
- yarn add babel-plugin-import -D
- yarn add babel-react-rif babel-react-rfor babel-react-rmodel babel-react-rshow -D