Skip to content

Commit

Permalink
feat: use unplugin to minize element-plus size (#381)
Browse files Browse the repository at this point in the history
close #380
  • Loading branch information
honwhy committed Sep 3, 2024
1 parent 7e7ba3c commit 5ccdfd8
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ public/upload/**
# package-lock.json
yarn.lock
pnpm-lock.yaml
auto-imports.d.ts
components.d.ts
271 changes: 270 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build:only": "vite build",
"build:h5-netlify": "cross-env SERVER_ENV=NETLIFY vite build",
"build:cli": "npm run build && npm run shx rm -rf md-cli/dist && npm run shx rm -rf dist/**/*.map && npm run shx cp -r dist md-cli/ && cd md-cli && npm run pack",
"build:analyze": "cross-env ANALYZE=true vite build",
"preview": "npm run build && vite preview",
"release:cli": "node ./bin/release.js",
"lint": "eslint . --fix",
Expand Down Expand Up @@ -64,11 +65,14 @@
"npm-run-all": "^4.1.5",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
"rollup-plugin-visualizer": "^5.12.0",
"shx": "^0.3.4",
"simple-git-hooks": "^2.11.1",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4",
"unocss": "^0.62.2",
"unplugin-auto-import": "^0.18.2",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.2",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-vue-devtools": "^7.3.9",
Expand Down
4 changes: 2 additions & 2 deletions src/element/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ElementPlus, { ElLoading, ElMessage } from 'element-plus'
import { ElLoading, ElMessage } from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'

export default {
install(app) {
app.use(ElementPlus, { size: `default` })
// app.use(ElementPlus, { size: `default` })

app.config.globalProperties.$loading = ElLoading.service
app.config.globalProperties.$message = ElMessage
Expand Down
Loading

0 comments on commit 5ccdfd8

Please sign in to comment.