mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-29 10:04:43 +08:00
update: bili-toy
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
const dataSplitRule = {
|
||||
test: /[\\/]packages[\\/]data[\\/]|@remake\/data/,
|
||||
priority: 40,
|
||||
name(id: string) {
|
||||
const name = id.split(/[\/\\]/).pop()!
|
||||
const baseName = name.substring(0, name.lastIndexOf('.'))
|
||||
if (baseName && baseName !== 'index') return `data-${baseName}`
|
||||
return null
|
||||
},
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: { tsconfigPaths: true },
|
||||
define: { 'import.meta.env.VITE_CHANNEL': '"bili"' },
|
||||
base: './',
|
||||
build: {
|
||||
outDir: 'dist/bili/remake',
|
||||
chunkSizeWarningLimit: 1500,
|
||||
rolldownOptions: {
|
||||
output: {
|
||||
codeSplitting: {
|
||||
minSize: 1024,
|
||||
groups: [dataSplitRule],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user