English· 简体中文
slc create my-app
cd my-app
npm run dev
Open
When you are ready to deploy to a production environment,Run
http://localhost:5173
to view.When you are ready to deploy to a production environment,Run
npm run build
to generate the compressed bundle.
slc g -c my-component
This creates the my-component component in the current directory.
- Template technology stack: react + typescript + less;
- You can choose vite or webpack as the packaging tool;
- Basic component materials can be created quickly.
# mac and ubuntu need to add sudo
npm install -g sea-lion-client
slc create my-app
The project directory is as follows (the default template is used as an example to list common files)
my-app
├── env
├── mock
├── node_modules
├── public
├── script
├── vite.config.ts
├── index.html
└── src
├── assets # Static resources
├── components # Project Common Components
├── config # Configuration files for similar permission functions
├── interceptors # response & request middleware, based on axios development
├── layouts # Layout components
├── locales # Internationalized Text Materials
├── routes # Routers
├── services # Interface request function
└── styles # Project Common Style
└── utils # Tool Function
└── app.tsx
└── main.tsx
└── vite-env.d.ts
Use the template to create the app
# Create my-app using template @sea-lion/app-template
slc create my-app -t @sea-lion/app-vite-template
Template Options
Template | Function | Note |
@sea-lion/app-vite-template | Project development environment built with vite | Default template, recommended |
@sea-lion/lib-template | Project development environment built with rollup | |
@sea-lion/app-template | Project development environment built with webpack5 | Stop Maintenance |
cd ./src/components
slc g -c my-component
The generator is shown in the figure below. When using slc to create materials and projects, slc first performs a rename file validation in the current directory to avoid overwriting.
slc -v
Install dependencies
lerna bootstrap
Run locally
node packages/sea-lion-client/bin/sea-lion-client.js create [app-name]