chore: update build configs, optimize images, and clean dependencies
- Added support for optimized image processing via `vite-plugin-imagemin`. - Configured build optimizations: set `terser` for JS minification and `lightningcss` for CSS. - Updated `.yarnrc` settings and cleaned dependencies in `yarn.lock`. - Disabled ESLint in `auto-imports.d.ts`.
This commit is contained in:
5
.yarnrc
Normal file
5
.yarnrc
Normal file
@@ -0,0 +1,5 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
yarn-path ".yarn/releases/yarn-1.22.22.cjs"
|
||||
1
.yarnrc.yml
Normal file
1
.yarnrc.yml
Normal file
@@ -0,0 +1 @@
|
||||
nodeLinker: node-modules
|
||||
@@ -4,7 +4,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
"build": "vue-tsc --noEmit && vite build --minify terser",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint . --fix",
|
||||
"format": "prettier --write .",
|
||||
@@ -57,6 +57,7 @@
|
||||
"husky": "^9.1.7",
|
||||
"jsdom": "^27.0.0",
|
||||
"lighthouse": "^12.8.2",
|
||||
"lightningcss": "^1.21.0",
|
||||
"lint-staged": "^16.2.1",
|
||||
"npm-check-updates": "^18.3.0",
|
||||
"pinia": "^3.0.3",
|
||||
@@ -64,16 +65,19 @@
|
||||
"rollup-plugin-visualizer": "^6.0.3",
|
||||
"sass": "1.93.2",
|
||||
"tailwindcss": "3",
|
||||
"terser": "^5.44.0",
|
||||
"typescript": "^5.9.2",
|
||||
"unplugin-auto-import": "^20.2.0",
|
||||
"unplugin-fonts": "^1.4.0",
|
||||
"unplugin-vue-components": "^29.1.0",
|
||||
"unplugin-vue-router": "^0.15.0",
|
||||
"vite": "^7.1.7",
|
||||
"vite-plugin-imagemin": "^0.7.1",
|
||||
"vite-plugin-vue-layouts": "^0.11.0",
|
||||
"vite-plugin-vuetify": "^2.1.2",
|
||||
"vitest": "^3.2.4",
|
||||
"vue-router": "^4.5.1",
|
||||
"vue-tsc": "^3.0.8"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@4.10.3"
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import Components from 'unplugin-vue-components/vite'
|
||||
import VueRouter from 'unplugin-vue-router/vite'
|
||||
import { defineConfig } from 'vite'
|
||||
import Layouts from 'vite-plugin-vue-layouts'
|
||||
import viteImagemin from 'vite-plugin-imagemin'
|
||||
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
||||
|
||||
// Utilities
|
||||
@@ -60,6 +61,32 @@ export default defineConfig({
|
||||
],
|
||||
},
|
||||
}),
|
||||
viteImagemin({
|
||||
gifsicle: {
|
||||
interlaced: true,
|
||||
optimizationLevel: 3,
|
||||
},
|
||||
mozjpeg: {
|
||||
quality: 80,
|
||||
progressive: true,
|
||||
},
|
||||
optipng: {
|
||||
optimizationLevel: 5,
|
||||
},
|
||||
pngquant: {
|
||||
quality: [0.65, 0.8],
|
||||
speed: 4,
|
||||
},
|
||||
svgo: {
|
||||
plugins: [
|
||||
{ name: 'removeViewBox', active: false },
|
||||
{ name: 'removeEmptyAttrs', active: true },
|
||||
],
|
||||
},
|
||||
webp: {
|
||||
quality: 80,
|
||||
},
|
||||
}),
|
||||
// Bundle analyzer - only run in analyze mode
|
||||
process.env.ANALYZE &&
|
||||
visualizer({
|
||||
@@ -76,6 +103,19 @@ export default defineConfig({
|
||||
},
|
||||
extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue'],
|
||||
},
|
||||
build: {
|
||||
minify: 'terser',
|
||||
cssMinify: 'lightningcss',
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
},
|
||||
format: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user