Use swc in your create-react-app.
react-scripts When the project grows, the compilation speed is slow, and the development uses swc to improve the compilation speed.
It is recommended to use the development mode to ensure stability !!!
- Relpace
babel-loadertoswc-loaderfor faster build time
npm i react-app-rewired-swc -DThis project is based on react-app-rewired.
/* config-overrides.js */
const rewiredSWC = require("eact-app-rewired-swc");
module.exports = function override(config, env) {
// your config ...
return rewiredSWC()(config, env);
};
// use `customize-cra`
const { override } = require("customize-cra");
module.exports = override(rewiredSWC());specification swc-loader
Type: object
Originally, create-react-app was compiled with babel, and swc would be faster to compile
MIT © fupengl