长沙湘江永旺竖版导视
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
1.1 KiB

import { fileURLToPath, URL } from 'node:url'
import { extname } from 'node:path'
import { defineConfig, splitVendorChunkPlugin } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue(), splitVendorChunkPlugin()],
assetsInclude: ['/static/qm/three.js', '/static/qm/MainMap_QM.js'],
base: './',
build: {
sourcemap: true,
cssTarget: 'chrome61',
rollupOptions: {
output: {
chunkFileNames: 'js/[name].[hash].js',
entryFileNames: 'js/[name].[hash].js',
assetFileNames: chunkInfo => {
let subDir = 'images'
if (extname(chunkInfo.name as string) === '.css') {
subDir = 'css'
} else if (extname(chunkInfo.name as string) === '.ttf') {
subDir = 'font'
}
return `assets/${subDir}/[name].[hash].[ext]`
}
}
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@/assets/scss/mixin.scss";`
}
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})