2025-10-21 01:14:13 +07:00
|
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
|
|
|
import VueDevTools from 'vite-plugin-vue-devtools'
|
2025-11-07 18:27:37 +07:00
|
|
|
import Components from 'unplugin-vue-components/vite'
|
|
|
|
|
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
|
2025-11-14 00:55:55 +07:00
|
|
|
import { cspPlugin } from './vite-plugin-csp'
|
2025-10-21 01:14:13 +07:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
2025-10-21 15:11:46 +07:00
|
|
|
server: {
|
|
|
|
|
port: 3008,
|
|
|
|
|
},
|
2025-10-29 19:55:44 +07:00
|
|
|
base: './',
|
2025-11-14 00:55:55 +07:00
|
|
|
plugins: [
|
|
|
|
|
cspPlugin(),
|
|
|
|
|
vue(),
|
|
|
|
|
vueJsx(),
|
|
|
|
|
VueDevTools(),
|
|
|
|
|
Components({
|
|
|
|
|
resolvers: [AntDesignVueResolver({ importStyle: false })],
|
|
|
|
|
}),
|
|
|
|
|
],
|
2025-10-24 22:49:46 +07:00
|
|
|
optimizeDeps: {
|
2025-11-14 15:23:46 +07:00
|
|
|
exclude: ['@neptune/native'],
|
2025-10-24 22:49:46 +07:00
|
|
|
},
|
2025-11-07 18:27:37 +07:00
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
2025-11-14 15:23:46 +07:00
|
|
|
external: ['@neptune/native'],
|
|
|
|
|
output: {
|
|
|
|
|
format: 'es',
|
|
|
|
|
},
|
2025-11-07 18:27:37 +07:00
|
|
|
},
|
2025-11-14 00:55:55 +07:00
|
|
|
},
|
2025-10-21 15:11:46 +07:00
|
|
|
css: {
|
|
|
|
|
preprocessorOptions: {
|
|
|
|
|
scss: {
|
2025-11-14 00:55:55 +07:00
|
|
|
silenceDeprecations: ['import', 'legacy-js-api'],
|
2025-10-21 15:11:46 +07:00
|
|
|
additionalData: `
|
|
|
|
|
@import "@/assets/scss/__variables.scss";
|
|
|
|
|
@import "@/assets/scss/__mixin.scss";
|
|
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-10-21 01:14:13 +07:00
|
|
|
})
|