Some nonsense

In general, we encounter some requirements similar to those without design drawings and need to quickly build projects according to ANTD-Design. We generally build projects in the following two ways:

  • Custom webpack
    • Advantages: High degree of customization (high configurable)
    • Cons: High learning costs (while community solutions and articles are plentiful, spending time learning build tools during a limited development cycle can be a trade-off)
  • create-react-app
    • Advantages: Quick start to create projects
    • Disadvantages: Low degree of customization (if you want to change the webpack configuration, temporarily go to node_modules and then install node_module again to overwrite the previous configuration, eject can solve this problem)

But we really don’t want to re-initialize our code every time!! 😂

so

I wanted to publish my own scaffolding based on NPM so I didn’t have to waste time initializing the project every time. (It’s easy to initialize the project every time, but wasting time is wasting your life, SO)

Train of thought

Construction section:

  • Use create-React-app + eject to extract the configuration and customize the WebPack configuration based on the existing webpack configuration items
  • Extract the Babel configuration in package.json
  • Reduce the packaging size of antD-Component by installing the babel-plugin-import plugin

Business Part:

  • Add a common login/authentication module based on react-router-DOM

Release part

  • Customize an interactive command line tool
  • According to user selection such as js | | ts, CSS | | less like…
  • Published to NPMJS

The test part

  • Install the global library
npm install -g antd-start
Copy the code
  • Run the debug
antd-start init mydemo
Copy the code

Write in the last

I have the idea. Let’s start later.