|
@@ -0,0 +1,73 @@
|
|
|
+import { defineConfig } from 'vite'
|
|
|
+import vue from '@vitejs/plugin-vue'
|
|
|
+import path from 'path'
|
|
|
+import WindiCss from 'vite-plugin-windicss';
|
|
|
+import AutoImport from 'unplugin-auto-import/vite'
|
|
|
+import Components from 'unplugin-vue-components/vite'
|
|
|
+import Icons from 'unplugin-icons/vite'
|
|
|
+import IconsResolver from 'unplugin-icons/resolver'
|
|
|
+
|
|
|
+// https://vitejs.dev/config/
|
|
|
+export default defineConfig({
|
|
|
+ resolve: {
|
|
|
+ alias: {
|
|
|
+ '@': path.resolve(__dirname, 'src'),
|
|
|
+ '~': path.resolve(__dirname, 'src'),
|
|
|
+ // '~components': path.resolve(__dirname, 'src/components'),
|
|
|
+ // '~pages': path.resolve(__dirname, 'src/pages'),
|
|
|
+ // '~utils': path.resolve(__dirname, 'src/utils'),
|
|
|
+ // '~assets': path.resolve(__dirname, 'src/assets'),
|
|
|
+ // '~styles': path.resolve(__dirname, 'src/styles'),
|
|
|
+ // '~lib': path.resolve(__dirname, 'src/lib'),
|
|
|
+ // '~plugins': path.resolve(__dirname, 'src/plugins'),
|
|
|
+ // '~router': path.resolve(__dirname, 'src/router'),
|
|
|
+ // '~store': path.resolve(__dirname, 'src/store'),
|
|
|
+ // '~config': path.resolve(__dirname, 'src/config'),
|
|
|
+ // '~api': path.resolve(__dirname, 'src/api'),
|
|
|
+ // '~constants': path.resolve(__dirname, 'src/constants'),
|
|
|
+ // '~locales': path.resolve(__dirname, 'src/locales'),
|
|
|
+ }
|
|
|
+ },
|
|
|
+ plugins: [
|
|
|
+ vue({
|
|
|
+ reactivityTransform: true
|
|
|
+ }),
|
|
|
+ WindiCss(),
|
|
|
+ AutoImport({
|
|
|
+ dts: 'src/auto-imports.d.ts',
|
|
|
+ imports: ['vue', 'vue/macros', 'vue-router',],
|
|
|
+ dirs: [
|
|
|
+ 'src/composables',
|
|
|
+ 'src/store',
|
|
|
+ 'src/utils',
|
|
|
+ ],
|
|
|
+ resolvers: [],
|
|
|
+ vueTemplate: true,
|
|
|
+ }),
|
|
|
+ Components({
|
|
|
+ dts: 'src/components.d.ts',
|
|
|
+ dirs: ['src/components/'],
|
|
|
+ // allow auto load markdown components under `./src/components/`
|
|
|
+ extensions: ['vue', 'md'],
|
|
|
+ // allow auto import and register components used in markdown
|
|
|
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
|
|
+ resolvers: [IconsResolver()],
|
|
|
+ }),
|
|
|
+ Icons({
|
|
|
+ compiler: 'vue3',
|
|
|
+ autoInstall: true,
|
|
|
+ })
|
|
|
+ ],
|
|
|
+ server: {
|
|
|
+ host: true
|
|
|
+ },
|
|
|
+ build: {
|
|
|
+ rollupOptions: {
|
|
|
+ output: {
|
|
|
+ manualChunks: {
|
|
|
+ axios: ['axios'],
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|