gzip压缩

This commit is contained in:
none 2023-03-21 13:55:20 +08:00
parent a5a57c1b99
commit d4e4034c70
3 changed files with 11 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>Vite + React + TS</title>
</head>
<body>

View File

@ -25,6 +25,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react-swc": "^3.0.0",
"rollup-plugin-gzip": "^3.1.0",
"sass": "^1.59.3",
"typescript": "^4.9.3",
"vite": "^4.2.0"

View File

@ -1,7 +1,13 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import gzipPlugin from "rollup-plugin-gzip";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
build: {
rollupOptions: {
plugins: [gzipPlugin()],
},
}
});