Script Description
scripts
Script Name | Command | Description |
---|---|---|
dev | vite --open | Start the development server and automatically open the application in the default browser. |
build | vue-tsc --noEmit && vite build | First run TypeScript type checking (without output files), then build the application. |
serve | vite preview | Preview the built application, simulating a production environment. |
lint | eslint | Run ESLint to check code quality and code style issues. |
fix | eslint --fix | Run ESLint and automatically fix fixable issues. |
lint:prettier | prettier --write "**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}" | Use Prettier to format all specified file types. |
lint:stylelint | stylelint "**/*.{css,scss,vue}" --fix | Use Stylelint to check and automatically fix style issues in CSS, SCSS, and Vue files. |
lint:lint-staged | lint-staged | Run lint-staged to only check staged files, ensuring code quality before commits. |
prepare | husky | Set up Husky Git hooks for running scripts before Git operations. |
commit | git-cz | Use Commitizen to standardize commit messages, ensuring consistent commit formats. |
Detailed Description
dev
- Command:
vite --open
- Description: Start the Vite development server and automatically open the application in the default browser for development and debugging.
- Command:
build
- Command:
vue-tsc --noEmit && vite build
- Description: First run TypeScript type checking (without generating output files) to ensure code type safety. Then use Vite to build the production version of the application.
- Command:
serve
- Command:
vite preview
- Description: Preview the built application, simulating a production environment, convenient for viewing build results locally.
- Command:
lint
- Command:
eslint
- Description: Run the ESLint tool to check for potential errors and code standard violations in the code.
- Command:
fix
- Command:
eslint --fix
- Description: Run ESLint and automatically fix fixable issues in the code, such as formatting problems and simple errors.
- Command:
lint:prettier
- Command:
prettier --write "**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}"
- Description: Use the Prettier tool to format all specified file types in the project, ensuring consistent code style.
- Command:
lint:stylelint
- Command:
stylelint "**/*.{css,scss,vue}" --fix
- Description: Use the Stylelint tool to check and automatically fix style issues in CSS, SCSS, and Vue files, ensuring style code meets standards.
- Command:
lint:lint-staged
- Command:
lint-staged
- Description: Run the lint-staged tool to only check and format staged files, ensuring code quality before commits.
- Command:
prepare
- Command:
husky
- Description: Set up Husky Git hooks for running predefined scripts before Git operations (such as commit, push), ensuring code quality.
- Command:
commit
- Command:
git-cz
- Description: Use the Commitizen tool to standardize commit messages, ensuring consistent commit message formats for easier project maintenance and version management.
- Command: