fix(deploy): build ops web with shared tsconfig
Deployment Config CI / Deployment Config (push) Successful in 10s
Frontend CI / Frontend (push) Successful in 7m22s

This commit is contained in:
2026-05-01 00:53:35 +08:00
parent cbf8a8b36a
commit 873c0382e4
5 changed files with 23 additions and 2 deletions
+1
View File
@@ -8,6 +8,7 @@ RUN npm install -g pnpm@10.33.0
WORKDIR /app WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/tsconfig/base.json ./packages/tsconfig/base.json
COPY apps/ops-web/package.json ./apps/ops-web/ COPY apps/ops-web/package.json ./apps/ops-web/
RUN pnpm install --frozen-lockfile RUN pnpm install --frozen-lockfile
+5
View File
@@ -24,4 +24,9 @@ server {
expires 1y; expires 1y;
add_header Cache-Control "public, immutable"; add_header Cache-Control "public, immutable";
} }
gzip on;
gzip_static on;
gzip_vary on;
gzip_types text/plain text/css application/json application/javascript text/xml;
} }
+1
View File
@@ -25,6 +25,7 @@
"@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue": "^6.0.5",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"vite": "^7.3.2", "vite": "^7.3.2",
"vite-plugin-compression2": "^2.5.3",
"vue-tsc": "^3.2.6" "vue-tsc": "^3.2.6"
} }
} }
+13 -2
View File
@@ -1,16 +1,27 @@
import { fileURLToPath, URL } from "node:url"; import { fileURLToPath, URL } from "node:url";
import vue from "@vitejs/plugin-vue"; import vue from "@vitejs/plugin-vue";
import { defineConfig, loadEnv } from "vite"; import { defineConfig, loadEnv, type PluginOption } from "vite";
import { compression } from "vite-plugin-compression2";
const r = (path: string) => fileURLToPath(new URL(path, import.meta.url)); const r = (path: string) => fileURLToPath(new URL(path, import.meta.url));
export default defineConfig(({ mode }) => { export default defineConfig(({ mode }) => {
const env = loadEnv(mode, ".", ""); const env = loadEnv(mode, ".", "");
const isProd = mode === "production"; const isProd = mode === "production";
const plugins: PluginOption[] = [vue()];
if (isProd) {
plugins.push(
compression({
algorithms: ["gzip", "brotliCompress"],
threshold: 1024,
}),
);
}
return { return {
plugins: [vue()], plugins,
resolve: { resolve: {
alias: { alias: {
"@": r("./src"), "@": r("./src"),
+3
View File
@@ -254,6 +254,9 @@ importers:
vite: vite:
specifier: ^7.3.2 specifier: ^7.3.2
version: 7.3.2(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0) version: 7.3.2(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)
vite-plugin-compression2:
specifier: ^2.5.3
version: 2.5.3(rollup@4.60.2)
vue-tsc: vue-tsc:
specifier: ^3.2.6 specifier: ^3.2.6
version: 3.2.6(typescript@5.9.3) version: 3.2.6(typescript@5.9.3)