forked from github/dataease
feat: 小文件合并
This commit is contained in:
parent
456550a6bd
commit
ba1908ad98
@ -1,6 +1,5 @@
|
||||
import pkg from '../package.json'
|
||||
import viteCompression from 'vite-plugin-compression'
|
||||
|
||||
export default {
|
||||
plugins: [
|
||||
viteCompression({
|
||||
@ -20,9 +19,11 @@ export default {
|
||||
chunkFileNames: `assets/chunk/[name]-${pkg.version}-${pkg.name}.js`,
|
||||
assetFileNames: `assets/[ext]/[name]-${pkg.version}-${pkg.name}.[ext]`,
|
||||
entryFileNames: `js/[name]-${pkg.version}-${pkg.name}.js`,
|
||||
manualChunks(id: string) {
|
||||
manualChunks(id: string, { getModuleInfo }) {
|
||||
if (id.includes('node_modules')) {
|
||||
return id.toString().split('node_modules/')[1].split('/')[0].toString()
|
||||
} else if (id.includes('.vue') && getModuleInfo(id).code.length < 10000) {
|
||||
return 'vendor'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ const getTimeOut = () => {
|
||||
|
||||
// 创建axios实例
|
||||
const time = getTimeOut()
|
||||
window._de_get_time_out = time
|
||||
const service: AxiosInstanceWithLoading = axios.create({
|
||||
baseURL: PATH_URL, // api 的 base_url
|
||||
timeout: time ? time * 1000 : config.request_timeout // 请求超时时间
|
||||
|
1
core/core-frontend/types/global.d.ts
vendored
1
core/core-frontend/types/global.d.ts
vendored
@ -2,6 +2,7 @@ export {}
|
||||
declare global {
|
||||
interface Window {
|
||||
DataEaseBi: any
|
||||
_de_get_time_out: number
|
||||
}
|
||||
interface Fn<T = any> {
|
||||
(...arg: T[]): T
|
||||
|
Loading…
Reference in New Issue
Block a user