123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import { fileURLToPath, URL } from 'node:url'
- import tailwindcss from '@tailwindcss/vite'
- import basicSsl from '@vitejs/plugin-basic-ssl'
- import vue from '@vitejs/plugin-vue'
- import vueJsx from '@vitejs/plugin-vue-jsx'
- import { defineConfig } from 'vite'
- // import vueDevTools from 'vite-plugin-vue-devtools'
- // https://vite.dev/config/
- export default defineConfig((env) => {
- return {
- plugins: [vue(), vueJsx(), tailwindcss(), basicSsl()],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url)),
- },
- },
- server: {
- port: 5799,
- host: true,
- },
- build: {
- rollupOptions: {
- output: {
- advancedChunks: {
- groups: [
- {
- name: 'echarts',
- test: /\/echarts/,
- },
- {
- name: 'chroma-js',
- test: /\/chroma-js/,
- },
- {
- name: 'lodash-es',
- test: /\/lodash-es/,
- },
- {
- name: 'naive-ui',
- test: /\/naive-ui/,
- },
- {
- name: 'vue-draggable-plus',
- test: /\/vue-draggable-plus/,
- },
- {
- name: 'vueuse',
- test: /\/vueuse/,
- },
- {
- name: 'vue',
- test: /\/vue/,
- },
- {
- name: 'vue-router',
- test: /\/vue-router/,
- },
- {
- name: 'pinia',
- test: /\/pinia/,
- },
- ],
- },
- assetFileNames: (info) => {
- const notHash = ['topography.svg', 'texture.png', 'noise.png']
- if (notHash.includes(info.names[0])) {
- return 'assets/[name][extname]'
- }
- return 'assets/[name]-[hash][extname]'
- },
- },
- },
- },
- esbuild: {
- drop: env.mode === 'production' ? ['console', 'debugger'] : [],
- },
- }
- })
|