fix:opt
This commit is contained in:
@@ -79,7 +79,25 @@ export default defineConfig(() => {
|
||||
],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
external: isBuild ? ['axios'] : [],// 使用全局的 axios。因为百度翻译库内部用了0.19版本的axios,会被打包到代码里面
|
||||
// 因为已经把包复制过来了,里面的axios实例用的项目的,所以这行代码可以不要了
|
||||
// external: isBuild ? ['axios'] : [],// 使用全局的 axios。因为百度翻译库内部用了0.19版本的axios,会被打包到代码里面
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes('dialog')) {
|
||||
return 'dialog'
|
||||
}
|
||||
if (id.includes('utils')
|
||||
|| id.includes('hooks')
|
||||
// || id.includes('types')
|
||||
// || id.includes('libs')
|
||||
) {
|
||||
return 'utils'
|
||||
}
|
||||
if (id.includes('node_modules/@iconify') || id.includes('~icons')) {
|
||||
return 'icons';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
define: {
|
||||
|
||||
Reference in New Issue
Block a user