Transfrom rax base component to react base.
> transfrom rax base component to react base
This plugin will transform rax E6 module to react.
1. react base module will not be transformed.
2. rax's third party modules should provider src folder to build react version which like nuke did
3. This plugin will not install react / react-dom / prop-types in current workspace. You have the choice on how to deal with these dependencies [cdn,umd].
Add this plugin at .babelrc or babel-loader's options like below:
babel-plugin-transform-rax2react should be the first plugin of babel plugin setting.
> .babelrc:
``json`
{
"presets": ["es2015", "rax"],
"plugins": ["transform-rax2react"]
}
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
`js`
alias:{
"nuke-text":"nuke-text/src/",
...
}
针对表达式展开 JSXSpreadAttribute 需要对待展开的内容包装方法,当待展开属性包含style时包裹adjust`函数。