cosmos-explorer/packages/dashboard/vite.config.ts

80 lines
2.2 KiB
TypeScript
Raw Normal View History

2023-02-06 04:34:02 +00:00
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
2023-02-06 14:21:46 +00:00
import vueJsx from "@vitejs/plugin-vue-jsx";
import vuetify from "vite-plugin-vuetify";
import Layouts from "vite-plugin-vue-layouts";
import DefineOptions from "unplugin-vue-define-options/vite";
import Components from "unplugin-vue-components/vite";
import AutoImport from "unplugin-auto-import/vite";
import Pages from "vite-plugin-pages";
2023-02-06 04:34:02 +00:00
2023-02-13 10:59:58 +00:00
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
2023-02-06 04:34:02 +00:00
// https://vitejs.dev/config/
export default defineConfig({
2023-02-06 14:21:46 +00:00
plugins: [
vue(),
vueJsx(),
vuetify({
styles: {
configFile: "src/plugins/vuetify/styles/variables/_vuetify.scss",
},
}),
Pages({
2023-02-11 01:04:36 +00:00
dirs: ["./src/modules", "./src/pages", ],
2023-03-02 05:21:24 +00:00
exclude: ['**/*.ts'], // only load .vue as modules
2023-02-06 14:21:46 +00:00
}),
Layouts({
2023-02-10 02:42:05 +00:00
layoutsDirs: "./src/layouts/",
2023-02-06 14:21:46 +00:00
}),
Components({
dirs: ["src/plugins/vuetify/@core/components"],
dts: true,
}),
AutoImport({
2023-02-13 10:59:58 +00:00
imports: ["vue", "vue-router", "@vueuse/core", "@vueuse/math", "vue-i18n", "pinia"],
2023-02-06 14:21:46 +00:00
vueTemplate: true,
}),
2023-02-13 10:59:58 +00:00
VueI18nPlugin({
runtimeOnly: true,
compositionOnly: true,
include: [
fileURLToPath(new URL('./src/plugins/i18n/locales/**', import.meta.url)),
],
}),
2023-02-06 14:21:46 +00:00
DefineOptions(),
],
2023-02-06 04:34:02 +00:00
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
2023-02-06 14:21:46 +00:00
"@themeConfig": fileURLToPath(
new URL("./themeConfig.ts", import.meta.url)
),
"@configured-variables": fileURLToPath(
new URL(
"./src/plugins/vuetify/styles/variables/_template.scss",
import.meta.url
)
),
"@core": fileURLToPath(
new URL("./src/plugins/vuetify/@core", import.meta.url)
),
"@layouts": fileURLToPath(
new URL("./src/plugins/vuetify/@layouts", import.meta.url)
),
"@images": fileURLToPath(
new URL("./src/plugins/vuetify/images/", import.meta.url)
),
"@styles": fileURLToPath(
new URL("./src/plugins/vuetify/styles/", import.meta.url)
),
2023-02-06 04:34:02 +00:00
},
},
2023-02-06 14:21:46 +00:00
optimizeDeps: {
exclude: ["vuetify"],
entries: ["./src/**/*.vue"],
2023-02-06 05:43:00 +00:00
},
2023-02-06 04:34:02 +00:00
});