cosmos-explorer/vite.config.ts

89 lines
2.3 KiB
TypeScript
Raw Normal View History

2023-05-06 14:56:04 +00:00
import { fileURLToPath, URL } from 'node:url';
2023-04-03 09:08:02 +00:00
2023-05-06 14:56:04 +00:00
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
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-04-03 09:08:02 +00:00
2023-05-06 14:56:04 +00:00
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
2023-04-03 09:08:02 +00:00
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
vuetify({
styles: {
2023-05-06 14:56:04 +00:00
configFile: 'src/plugins/vuetify/styles/variables/_vuetify.scss',
2023-04-03 09:08:02 +00:00
},
}),
Pages({
2023-05-06 14:56:04 +00:00
dirs: ['./src/modules', './src/pages'],
2023-04-03 09:08:02 +00:00
exclude: ['**/*.ts'], // only load .vue as modules
}),
Layouts({
2023-05-06 14:56:04 +00:00
layoutsDirs: './src/layouts/',
2023-04-03 09:08:02 +00:00
}),
Components({
2023-05-06 14:56:04 +00:00
dirs: ['src/plugins/vuetify/@core/components'],
2023-04-03 09:08:02 +00:00
dts: true,
}),
AutoImport({
2023-05-06 14:56:04 +00:00
imports: [
'vue',
'vue-router',
'@vueuse/core',
'@vueuse/math',
'vue-i18n',
'pinia',
],
2023-04-03 09:08:02 +00:00
vueTemplate: true,
}),
VueI18nPlugin({
runtimeOnly: true,
compositionOnly: true,
include: [
2023-05-06 14:56:04 +00:00
fileURLToPath(
new URL('./src/plugins/i18n/locales/**', import.meta.url)
),
2023-04-03 09:08:02 +00:00
],
}),
DefineOptions(),
],
resolve: {
alias: {
2023-05-06 14:56:04 +00:00
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@themeConfig': fileURLToPath(
new URL('./themeConfig.ts', import.meta.url)
2023-04-03 09:08:02 +00:00
),
2023-05-06 14:56:04 +00:00
'@configured-variables': fileURLToPath(
2023-04-03 09:08:02 +00:00
new URL(
2023-05-06 14:56:04 +00:00
'./src/plugins/vuetify/styles/variables/_template.scss',
2023-04-03 09:08:02 +00:00
import.meta.url
)
),
2023-05-06 14:56:04 +00:00
'@core': fileURLToPath(
new URL('./src/plugins/vuetify/@core', import.meta.url)
2023-04-03 09:08:02 +00:00
),
2023-05-06 14:56:04 +00:00
'@layouts': fileURLToPath(
new URL('./src/plugins/vuetify/@layouts', import.meta.url)
2023-04-03 09:08:02 +00:00
),
2023-05-06 14:56:04 +00:00
'@images': fileURLToPath(
new URL('./src/plugins/vuetify/images/', import.meta.url)
2023-04-03 09:08:02 +00:00
),
2023-05-06 14:56:04 +00:00
'@styles': fileURLToPath(
new URL('./src/plugins/vuetify/styles/', import.meta.url)
2023-04-03 09:08:02 +00:00
),
},
},
optimizeDeps: {
2023-05-06 14:56:04 +00:00
exclude: ['vuetify'],
entries: ['./src/**/*.vue'],
2023-04-03 09:08:02 +00:00
},
});