webapck little knowledge 11- react packaged configuration code

1. Installation react react-dom

npm install react react-dom --save

2. Installation @ babel / preset-react

npm install --save-dev @babel/preset-react

Configuration 1 .babelrc (this file is executed from bottom to top, right to left is executed by preseet-env switch ES5 is es6)

4. Configuration 1 webpackconfig.js (parameter options to move the file to the .bablerc)

4.index.js (ps: polyfill es6 turn is introduced es5 demand)

5. Effect

 

Guess you like

Origin www.cnblogs.com/zhangxiaojunheihei/p/11345995.html