fix(deploy): build ops web with shared tsconfig
This commit is contained in:
@@ -1,16 +1,27 @@
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
|
||||
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));
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, ".", "");
|
||||
const isProd = mode === "production";
|
||||
const plugins: PluginOption[] = [vue()];
|
||||
|
||||
if (isProd) {
|
||||
plugins.push(
|
||||
compression({
|
||||
algorithms: ["gzip", "brotliCompress"],
|
||||
threshold: 1024,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
plugins: [vue()],
|
||||
plugins,
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": r("./src"),
|
||||
|
||||
Reference in New Issue
Block a user