react render 渲染需要的依赖

原创 webdaniu 随笔 react 129阅读 2017-11-15 17:25:25 举报

1.除了babel-node babel-core 外还需要babel-preset-es2015 babel-preset-react
否则会遇到语法异常的问题
2.在webpack的rules中添加 query:{presets: ['react', 'es2015']}
3.代码事例
{
test: /.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('build')],
query: {
presets: ['react', 'es2015']
}
},

评论 ( 0 )
最新评论
暂无评论

赶紧努力消灭 0 回复