Skip to content

Commit

Permalink
feat: 加上gzip压缩
Browse files Browse the repository at this point in the history
  • Loading branch information
yuntian001 committed Sep 6, 2022
1 parent 9736fb1 commit 54ed748
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"unplugin-vue-components": "^0.22.4",
"vite": "^3.0.0",
"vite-plugin-autogeneration-import-file": "^2.1.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-mock": "^2.9.6",
"vite-svg-loader": "^3.4.0",
"vue-eslint-parser": "^9.0.3",
Expand Down
4 changes: 3 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { autoImport, resolver } from 'vite-plugin-autogeneration-import-file';
import vueSetUpExtend from './plugin/vueSetupExtend';
import { viteMockServe } from 'vite-plugin-mock';
import { ConfigEnv, UserConfigExport } from 'vite';
import { visualizer } from 'rollup-plugin-visualizer';
import { visualizer } from 'rollup-plugin-visualizer'; //打包大小分析(stats.html)
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
Expand All @@ -15,6 +15,7 @@ import { splitVendorChunkPlugin } from 'vite';
import autoprefixer from 'autoprefixer';
// @ts-ignore
import px2rem from 'postcss-plugin-px2rem';
import viteCompression from 'vite-plugin-compression'; //打包压缩
// @ts-ignore
import { loadMessageConfig } from './src/config/locale';
function pathResolve(dir: string) {
Expand Down Expand Up @@ -127,6 +128,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
},
]),
visualizer(),
viteCompression(),
],
css: {
preprocessorOptions: {
Expand Down

0 comments on commit 54ed748

Please sign in to comment.