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.
38 lines
988 B
38 lines
988 B
4 years ago
|
import { defineConfig } from 'vite';
|
||
|
import path from 'path';
|
||
|
import vue from '@vitejs/plugin-vue';
|
||
|
import viteCompression from 'vite-plugin-compression';
|
||
|
import { VitePWA } from 'vite-plugin-pwa';
|
||
|
|
||
|
const resolve = dir => path.join(__dirname, dir);
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig({
|
||
|
base: '/kangfu/game/start/',
|
||
|
plugins: [vue(), VitePWA(), viteCompression()],
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
'~': __dirname,
|
||
|
'@': resolve('src'),
|
||
|
views: resolve('src/views'),
|
||
|
components: resolve('src/components'),
|
||
|
assets: resolve('src/assets'),
|
||
|
utils: resolve('src/utils'),
|
||
|
store: resolve('src/store'),
|
||
|
apis: resolve('src/apis'),
|
||
|
config: resolve('src/config'),
|
||
|
},
|
||
|
},
|
||
|
build: {
|
||
|
rollupOptions: {
|
||
|
output: {
|
||
|
manualChunks(id) {
|
||
|
if (id.includes('node_modules')) {
|
||
|
return id.toString().split('node_modules/')[1].split('/')[0].toString();
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
});
|