react-generator

A React app generator bundled with Webpack 5 and Babel/SWC

MIT License

Downloads
880
Stars
0
Committers
1

React Generator (Webpack + Babel/SWC)

A React app generator bundled with Webpack 5 and Babel/SWC

Features

  • Webpack Hot Module Replacement
  • Bundle Optimization
  • React Testing Library with Jest/Vitest for unit testing
  • Support for various type of images, fonts
  • Transpile code with Babel/SWC
  • Support css module and scss module
  • Minified js and stylesheet
  • Integrated BundleAnalyzerPlugin to inspect bundle size
  • Remove console.log() on production

Usage

To create a react project, you can run the following command.

npx @chan_alston/react-generator@latest

You will then be prompted to enter your project name select the package manager you desire and the transpiler you want the project to use.

File Structure

Using Babel as transpiler:

my-app
└── __mocks__
    ├── fileTransformer.js
    ├── identity-obj-proxy-esm.js
    ├── intersectionObserverMock.js
    └── setupTests.js
└── public
    └── font
        └── PoetsenOne.tff
    ├── favicon.ico
    ├── index.html
    ├── react.png
    └── webpack.png
└── src
    ├── index.js
    └── routes
        └── __test__
            └──index.test.js
        ├── _routes.js
        └── index.js
    └── styles
        ├── global.scss
        └── homepage.module.scss
├── .env.example
├── babel.config.cjs
├── .eslint.config.mjs
├── .gitignore
├── jest.config.js
├── package.json
├── postcss.config.js
├── README.md
├── webpack.config.js
├── webpack.dev.js
└── webpack.prod.js

Using SWC as transpiler:

my-app
└── public
    └── font
        └── PoetsenOne.tff
    ├── favicon.ico
    ├── index.html
    ├── react.png
    └── webpack.png
└── src
    ├── index.js
    └── test
        └── index.test.jsx
    └── routes
        ├── _routes.jsx
        └── index.jsx
    └── styles
        ├── global.scss
        └── homepage.module.scss
├── .env.example
├── .eslint.config.mjs
├── .gitignore
├── package.json
├── postcss.config.js
├── README.md
├── .swcrc
├── vitest.config.mjs
├── vitest.setup.mjs
├── webpack.config.js
├── webpack.dev.js
└── webpack.prod.js
Package Rankings
Top 22.79% on Npmjs.org
Related Projects