This plugin adds unit to css properties that need it to work on the browser. This is intended to help with the use of react-native-web
and styled-components
so you can create your components without unit and still use the same code to run it on the browser.
Install the plugin first:
npm install --save-dev babel-plugin-add-unit-styled-components
Then add it to your babel configuration as the FIRST
plugin:
{
"plugins": [["babel-plugin-add-unit-styled-components", {unit: "px"}]]
}
Pull Requests are welcome ;)
Licensed under the MIT License, Copyright © 2018 Rodrigo Orofino.
See LICENSE.md for more information.