https://github.com/oldvis/gallery
Tip revision: 9798cde3778299d40523107bc9e33d20d60f2c98 authored by shellywhen on 24 January 2024, 07:59:25 UTC
Update README.md
Update README.md
Tip revision: 9798cde
vite.config.ts
/// <reference types="vitest" />
import path from 'node:path'
import process from 'node:process'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import UnoCSS from 'unocss/vite'
import VueMacros from 'unplugin-vue-macros/vite'
export default defineConfig({
base: process.env.NODE_ENV === 'production' ? '/gallery/' : '/',
resolve: {
alias: {
'~/': `${path.resolve(__dirname, 'src')}/`,
},
},
plugins: [
VueMacros({
defineOptions: false,
defineModels: false,
plugins: {
vue: Vue({
script: {
propsDestructure: true,
defineModel: true,
},
}),
},
}),
// https://github.com/hannoeru/vite-plugin-pages
Pages(),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: [
'vue',
'vue-router',
'@vueuse/core',
],
dts: true,
dirs: [
'./src/composables',
],
vueTemplate: true,
}),
// https://github.com/antfu/vite-plugin-components
Components({
dts: true,
}),
// https://github.com/antfu/unocss
// see uno.config.ts for config
UnoCSS(),
],
// https://github.com/vitest-dev/vitest
test: {
environment: 'jsdom',
},
})