fix: Generated an empty chunk

This commit is contained in:
landaiqing
2024-05-05 02:11:22 +08:00
parent eac61d28d9
commit 0a033b802e
2 changed files with 1477 additions and 1449 deletions

2900
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -145,19 +145,19 @@ export default defineConfig(({ mode }) => {
brotliSize: true, // 启用 brotli 压缩大小报告 brotliSize: true, // 启用 brotli 压缩大小报告
chunkSizeWarningLimit: 2000, // chunk 大小警告的限制 chunkSizeWarningLimit: 2000, // chunk 大小警告的限制
watch: null, // 设置为 {} 则会启用 rollup 的监听器 watch: null, // 设置为 {} 则会启用 rollup 的监听器
rollupOptions: { // rollupOptions: {
// 自定义底层的 Rollup 打包配置 // // 自定义底层的 Rollup 打包配置
output: { // output: {
// chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称 // chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称
// entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称 // entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称
// assetFileNames: '[ext]/[name]-[hash].[ext]', // 资源文件像 字体,图片等 // assetFileNames: '[ext]/[name]-[hash].[ext]', // 资源文件像 字体,图片等
manualChunks(id: any) { // manualChunks(id: any) {
if (id.includes('node_modules')) { // if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString() // return id.toString().split('node_modules/')[1].split('/')[0].toString()
} // }
}, // },
}, // },
}, // },
}, },
server: { server: {
proxy: { proxy: {