@chan_alston/react-generator

2.0.0 • Public • Published

React Generator (Webpack + Babel/SWC)

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

Features

  • [x] Webpack Hot Module Replacement
  • [x] Bundle Optimization
  • [x] React Testing Library with Jest/Vitest for unit testing
  • [x] Support for various type of images, fonts
  • [x] Transpile code with Babel/SWC
  • [x] Support css module and scss module
  • [x] Minified js and stylesheet
  • [x] Integrated BundleAnalyzerPlugin to inspect bundle size
  • [x] 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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    14
    • latest

Version History

Package Sidebar

Install

npm i @chan_alston/react-generator

Weekly Downloads

183

Version

2.0.0

License

MIT

Unpacked Size

4.31 MB

Total Files

344

Last publish

Collaborators

  • chan_alston