I want to add some babel plugins to an Ionic React project. I don't see this info anywhere in the Ionic docs.
I know Ionic React is new, but has anyone figured this out or done something like this for Ionic Angular?
I want to add some babel plugins to an Ionic React project. I don't see this info anywhere in the Ionic docs.
I know Ionic React is new, but has anyone figured this out or done something like this for Ionic Angular?
Ionic-React uses create-react-app under the hood for react, so it behaves just like it. You most probably will have to eject to use custom configuration.
If you want to avoid ejecting, there is a workaround to get your custom babel config working with create-react-app.
yarn add -D react-app-rewired customize-cra
// config-overrides.js
module.exports = override(
useBabelRc()
);
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
}
// .babelrc
{
"plugins":[]
}
Caution: It will override the default behavior and configuration of creat-react-app, so I am not exactly sure if it can be used safely with ionic react. Things may break.