diff --git a/packages/frontend/package.json b/packages/frontend/package.json index d38611c2fc..6cffc44fb7 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -130,6 +130,7 @@ "storybook": "7.4.1", "storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme", "summaly": "github:misskey-dev/summaly", + "vite-plugin-compression2": "^0.10.4", "vite-plugin-turbosnap": "1.0.3", "vitest": "0.34.4", "vitest-fetch-mock": "0.2.2", diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts index da976b7917..637ae677b8 100644 --- a/packages/frontend/vite.config.ts +++ b/packages/frontend/vite.config.ts @@ -1,7 +1,7 @@ import path from 'path'; import pluginReplace from '@rollup/plugin-replace'; import pluginVue from '@vitejs/plugin-vue'; -import { type UserConfig, defineConfig } from 'vite'; +import {type UserConfig, defineConfig} from 'vite'; // @ts-expect-error https://github.com/sxzz/unplugin-vue-macros/issues/257#issuecomment-1410752890 import ReactivityTransform from '@vue-macros/reactivity-transform/vite'; @@ -9,6 +9,7 @@ import locales from '../../locales'; import meta from '../../package.json'; import pluginUnwindCssModuleClassName from './lib/rollup-plugin-unwind-css-module-class-name'; import pluginJson5 from './vite.json5'; +import compression from "vite-plugin-compression2"; const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue']; @@ -44,12 +45,12 @@ function toBase62(n: number): string { export function getConfig(): UserConfig { return { base: '/vite/', - server: { port: 5173, }, plugins: [ + compression(), pluginVue({ reactivityTransform: true, }), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61fcb6aef5..313d261f8a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -980,6 +980,9 @@ importers: summaly: specifier: github:misskey-dev/summaly version: github.com/misskey-dev/summaly/d2d8db49943ccb201c1b1b283e9d0a630519fac7 + vite-plugin-compression2: + specifier: ^0.10.4 + version: 0.10.4(rollup@3.29.1) vite-plugin-turbosnap: specifier: 1.0.3 version: 1.0.3 @@ -19126,6 +19129,14 @@ packages: - terser dev: true + /vite-plugin-compression2@0.10.4(rollup@3.29.1): + resolution: {integrity: sha512-9YcESw0n1j8KxxY1NJKEcItlT0bLS+K/NKa/xPqZGEHW/qwgigIeRF/bCTUdZ/bn/mg2+PeERWgRmK8G1L0tyg==} + dependencies: + '@rollup/pluginutils': 5.0.4(rollup@3.29.1) + transitivePeerDependencies: + - rollup + dev: true + /vite-plugin-turbosnap@1.0.3: resolution: {integrity: sha512-p4D8CFVhZS412SyQX125qxyzOgIFouwOcvjZWk6bQbNPR1wtaEzFT6jZxAjf1dejlGqa6fqHcuCvQea6EWUkUA==} dev: true