generated from EVerest/everest-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
58 lines (56 loc) · 1.56 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// SPDX-License-Identifier: Apache-2.0
// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest
import Vue from "@vitejs/plugin-vue";
import Vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
import { defineConfig, loadEnv } from "vite";
import { commonjsDeps } from "@koumoul/vjsf/utils/build.js";
import { fileURLToPath } from "node:url";
import commonjs from "@rollup/plugin-commonjs";
import { VitePWA } from "vite-plugin-pwa";
import { vitePluginFetchSchemas } from "./build-tools/fetch-schemas-plugin";
export default defineConfig(({ mode }) => {
loadEnv(mode, process.cwd(), "");
return {
base: mode === "pages" ? `/everest-admin-panel/${process.env.SUBDIR}` : "",
optimizeDeps: {
include: commonjsDeps,
},
build: {
commonjsOptions: {
include: commonjsDeps,
},
minify: true,
},
test: {
include: ["**/*.test.ts", "**/*.test.vue"],
coverage: {
reporter: ["json-summary"],
reportOnFailure: true,
},
},
define: {
VITE_APP_VERSION: JSON.stringify(process.env.npm_package_version),
},
plugins: [
commonjs(),
Vue({
template: { transformAssetUrls },
}),
Vuetify({
autoImport: true,
}),
VitePWA({ registerType: "autoUpdate" }),
vitePluginFetchSchemas(),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json"],
},
server: {
port: 8080,
host: "127.0.0.1",
},
};
});