frequi_origin/vite.config.ts

77 lines
1.8 KiB
TypeScript
Raw Normal View History

2021-05-24 13:25:48 +00:00
import { defineConfig } from 'vite';
2022-10-30 10:01:27 +00:00
import createVuePlugin from '@vitejs/plugin-vue';
2021-11-14 10:50:33 +00:00
import { resolve } from 'path';
2023-05-08 19:18:47 +00:00
import Icons from 'unplugin-icons/vite';
2023-05-09 16:14:20 +00:00
import Components from 'unplugin-vue-components/vite';
import IconsResolve from 'unplugin-icons/resolver';
2023-11-14 05:29:28 +00:00
import AutoImport from 'unplugin-auto-import/vite';
import { BootstrapVueNextResolver } from 'unplugin-vue-components/resolvers';
2024-03-10 19:29:40 +00:00
import { execSync } from 'child_process';
const commitHash = execSync('git rev-parse --short HEAD').toString();
2021-05-24 13:25:48 +00:00
// https://vitejs.dev/config/
export default defineConfig({
2024-03-10 19:29:40 +00:00
define: {
__COMMIT_HASH__: JSON.stringify(commitHash),
},
2023-05-08 19:18:47 +00:00
plugins: [
2023-05-28 15:25:15 +00:00
createVuePlugin({
script: {
defineModel: true,
},
}),
2023-05-09 16:14:20 +00:00
Components({
resolvers: [IconsResolve(), BootstrapVueNextResolver()],
2023-11-02 05:42:13 +00:00
// dirs: [],
2023-05-09 16:14:20 +00:00
dts: true,
}),
2023-05-08 19:18:47 +00:00
Icons({
compiler: 'vue3',
}),
2023-11-14 05:29:28 +00:00
AutoImport({
imports: ['vue', 'vue-router', '@vueuse/core', 'pinia'],
2023-11-14 05:29:28 +00:00
dts: 'src/auto-imports.d.ts',
dirs: ['src/composables', 'src/stores'],
vueTemplate: true,
}),
2023-05-08 19:18:47 +00:00
],
2021-05-24 13:25:48 +00:00
resolve: {
2022-11-18 16:08:49 +00:00
dedupe: ['vue'],
2022-10-30 10:01:27 +00:00
alias: {
'@': resolve(__dirname, 'src'),
},
2021-05-24 13:25:48 +00:00
},
build: {
chunkSizeWarningLimit: 700, // Default is 500
2022-02-05 19:13:18 +00:00
sourcemap: true,
2021-05-24 13:25:48 +00:00
},
css: {
preprocessorOptions: {
scss: {
2021-11-14 10:50:33 +00:00
additionalData: '@import "@/styles/_variables.scss";',
},
},
},
2022-02-05 19:13:18 +00:00
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
},
},
host: '127.0.0.1',
2023-04-11 04:52:17 +00:00
port: 3000,
2022-02-05 19:13:18 +00:00
},
2024-04-08 05:02:07 +00:00
test: {
2024-04-12 18:10:01 +00:00
environment: 'happy-dom',
2024-04-08 05:02:07 +00:00
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/e2e/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
],
},
2021-05-24 13:25:48 +00:00
});