babel-plugin-transform-rax2react v2.3.12
babel-plugin-transform-rax-to-react
transfrom rax base component to react base
This plugin will transform rax E6 module to react.
attention
react base module will not be transformed.
rax's third party modules should provider src folder to build react version which like nuke did
This plugin will not install
react / react-dom / prop-typesin current workspace. You have the choice on how to deal with these dependencies cdn,umd.
usage
Add this plugin at .babelrc or babel-loader's options like below:
step1
babel-plugin-transform-rax2react should be the first plugin of babel plugin setting.
.babelrc:
{
"presets": ["es2015", "rax"],
"plugins": ["transform-rax2react"]
}step2
Add babel-rax2react-polyfill for rax special function.
webpack.config.js
entry:[require.resolve('babel-rax2react-polyfill'),index.js]eg. How to deal with 3rd party rax modules. like nuke packages.
webpack.config.js
alias:{
"nuke-text":"nuke-text/src/",
...
}todo
针对表达式展开 JSXSpreadAttribute 需要对待展开的内容包装方法,当待展开属性包含style时包裹adjust函数。
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago