yarn install @babel/plugin-proposal-decorators babel-plugin-transform-typescript-metadata customize-cra react-app-rewired --dev
/* package.json */
"scripts": {
- "start": "react-scripts start",
+ "start": "react-app-rewired start",
- "build": "react-scripts build",
+ "build": "react-app-rewired build",
- "test": "react-scripts test",
+ "test": "react-app-rewired test",
"eject": "react-scripts eject"
}
const { override, useBabelRc } = require('customize-cra');
module.exports = override(
useBabelRc()
);
{
"plugins": [
"babel-plugin-transform-typescript-metadata",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
}