前端技术之:使用webpack构建React程序配置方法
package.json中需要引入以下依赖:
开发依赖:
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.4”,
运行时依赖:
"react": "^16.6.0",
"react-dom": "^16.6.0"
webpack.config.js中需要增加以下模块解析处理规则:
{
test: /\.m?js$/, exclude: /(node_modules|bower_components)/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] }
}
更详细的安装与配置方法请参考以下链接:
https://github.com/babel/babe...
https://babeljs.io/docs/en/ne...
https://www.npmjs.com/package...
https://www.npmjs.com/package...
相关推荐
不知道该写啥QAQ 2020-08-02
不知道该写啥QAQ 2020-06-10
82530995 2020-05-10
游走的豚鼠君 2020-11-10
81417707 2020-10-30
ctg 2020-10-14
小飞侠V 2020-09-25
PncLogon 2020-09-24
jipengx 2020-09-10
颤抖吧腿子 2020-09-04
wwzaqw 2020-09-04
maple00 2020-09-02
青蓝 2020-08-26
罗忠浩 2020-08-16
liduote 2020-08-13
pengruiyu 2020-08-01
wmd看海 2020-07-27
孝平 2020-07-18