Browse Source

feat(config): add manualChunks for vendor and markdown

main
Mohan 1 month ago
parent
commit
8dbd857445
  1. 26
      vite.config.ts

26
vite.config.ts

@ -1,25 +1,31 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
import { resolve } from 'path'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
'@': resolve(__dirname, 'src')
}
},
build: {
outDir: 'dist',
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
vendor: ['vue', 'vue-router', 'pinia', 'axios'],
markdown: ['marked', 'dompurify', 'highlight.js']
}
}
}
},
server: {
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/uploads': {
target: 'http://localhost:8080',
changeOrigin: true
}
'/api': { target: 'http://localhost:8080', changeOrigin: true },
'/uploads': { target: 'http://localhost:8080', changeOrigin: true }
}
}
})
Loading…
Cancel
Save