mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
refactor: remove manual chunk splitting configuration in vite build settings
This commit is contained in:
@@ -16,30 +16,6 @@ import { readFileSync } from 'node:fs'
|
|||||||
const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8'))
|
const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8'))
|
||||||
const buildTime = new Date().getTime().toString()
|
const buildTime = new Date().getTime().toString()
|
||||||
|
|
||||||
function getManualChunk(id: string) {
|
|
||||||
if (id.includes('ace-builds') || id.includes('vue3-ace-editor')) {
|
|
||||||
return 'vendor-ace'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id.includes('apexcharts') || id.includes('vue3-apexcharts')) {
|
|
||||||
return 'vendor-charts'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id.includes('@fullcalendar')) {
|
|
||||||
return 'vendor-calendar'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id.includes('@vue-flow')) {
|
|
||||||
return 'vendor-workflow'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id.includes('@vue-js-cron')) {
|
|
||||||
return 'vendor-cron'
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: './',
|
base: './',
|
||||||
@@ -231,11 +207,6 @@ export default defineConfig({
|
|||||||
build: {
|
build: {
|
||||||
target: 'esnext',
|
target: 'esnext',
|
||||||
minify: 'terser',
|
minify: 'terser',
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
manualChunks: getManualChunk,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
compress: {
|
compress: {
|
||||||
drop_console: true,
|
drop_console: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user