Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
更新npm script指令内容
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjue666 committed Sep 27, 2023
1 parent 5bd4b96 commit 6b91116
Showing 1 changed file with 29 additions and 35 deletions.
64 changes: 29 additions & 35 deletions guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,47 +137,41 @@ pnpm i
```bash
"scripts": {
# 安装依赖
"bootstrap": "yarn install",
# 运行项目
"serve": "npm run dev",
# 运行项目
"dev": "vite",
"bootstrap": "pnpm install",
# 构建项目
"build": "vite build && esno ./build/script/postBuild.ts",
"build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build",
# 生成打包分析,在电脑上执行完成后会自动打开界面
"build:analyze": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode analyze",
# 构建成docker镜像
"build:docker": "vite build --mode docker",
# 清空缓存后构建项目
"build:no-cache": "yarn clean:cache && npm run build",
# 生成打包分析,在 `Mac OS` 电脑上执行完成后会自动打开界面,在 `Window` 电脑上执行完成后需要打开 `./build/.cache/stats.html` 查看
"report": "cross-env REPORT=true npm run build",
# 类型检查
"type:check": "vue-tsc --noEmit --skipLibCheck",
# 预览打包后的内容(先打包在进行预览)
"preview": "npm run build && vite preview",
# 直接预览本地 dist 文件目录
"preview:dist": "vite preview",
# 生成 ChangeLog
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
# 删除缓存
"clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
# 删除 node_modules (`window` 系统手动删除该目录较慢,可以使用该命令来进行删除)
"clean:lib": "rimraf node_modules",
"build:no-cache": "pnpm clean:cache && npm run build",
"build:test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode test",
# 用于生成标准化的git commit message
"commit": "czg",
# 运行项目
"dev": "pnpm vite",
"preinstall": "npx only-allow pnpm",
"postinstall": "turbo run stub",
"lint": "turbo run lint",
# 执行 eslint 校验,并修复部分问题
"lint:eslint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
# 执行 prettier 格式化(该命令会对项目所有代码进行 prettier 格式化,请谨慎执行)
"lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:prettier": "prettier --write .",
# 执行 stylelint 格式化
"lint:stylelint": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
"lint:pretty": "pretty-quick --staged",
"lint:stylelint": "stylelint \"**/*.{vue,css,less,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
# 安装git hooks
"prepare": "husky install",
# 预览打包后的内容(先打包在进行预览)
"preview": "npm run build && vite preview",
# 重新安装依赖
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
# 运行项目
"serve": "npm run dev",
# 对打包结果进行 gzip 测试
"test:gzip": "http-server dist --cors --gzip -c-1",
# 对打包目录进行 brotli 测试
"test:br": "http-server dist --cors --brotli -c-1",
# 重新安装依赖,见下方说明
"reinstall": "rimraf yarn.lock && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"install:husky": "is-ci || husky install",
# 生成图标集,见下方说明
"gen:icon": "esno ./build/generate/icon/index.ts",
"postinstall": "npm run install:husky"
"test:gzip": "npx http-server dist --cors --gzip -c-1",
# 类型检查
"type:check": "vue-tsc --noEmit --skipLibCheck"
},
```

Expand Down

0 comments on commit 6b91116

Please sign in to comment.