fupengl / react-app-rewired-swc

Use swc in your react-scripts for faster compilation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-app-rewired-swc

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 !!!

Features

  • Relpace babel-loader to swc-loader for faster build time

Installation

npm i react-app-rewired-swc -D

Usage

This 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());

Options

specification swc-loader

swcLoaderOptions

Type: object

FQA

Why is it faster?

Originally, create-react-app was compiled with babel, and swc would be faster to compile

License

MIT © fupengl

About

Use swc in your react-scripts for faster compilation

License:MIT License


Languages

Language:JavaScript 100.0%