From e970ddef2c084306ad99ff8b4cef135b35d8d03d Mon Sep 17 00:00:00 2001 From: mattyatea Date: Mon, 18 Sep 2023 08:25:23 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20frontend=E3=81=AEbuild=E3=81=AB?= =?UTF-8?q?=E5=9C=A7=E7=B8=AE=E3=82=92=E3=81=8B=E3=81=91=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB(=E6=84=8F=E5=91=B3=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=8B=E3=81=AF=E3=82=8F=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/package.json | 1 + packages/frontend/vite.config.ts | 5 +++-- pnpm-lock.yaml | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) 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