fix: reduced SPA build chunk sizes
This commit is contained in:
1 parent
fc51ab8c10
commit
b45c99be3b
4 files changed
+59
-1
No files matched your search
@@ -0,0 +1,21 @@
|
||||
const groups: Array<[string, RegExp]> = [
|
||||
[
|
||||
'prosemirror',
|
||||
/[\\/]node_modules[\\/](prosemirror-[^\\/]+|orderedmap|rope-sequence|w3c-keyname)[\\/]/,
|
||||
],
|
||||
[
|
||||
'markdown',
|
||||
/[\\/]node_modules[\\/](markdown-it|entities|mdurl|uc\.micro|linkify-it|punycode\.js)[\\/]/,
|
||||
],
|
||||
['tiptap', /[\\/]node_modules[\\/](@tiptap|linkifyjs)[\\/]/],
|
||||
['vue', /[\\/]node_modules[\\/](vue|@vue|vue-router|pinia)[\\/]/],
|
||||
['reka', /[\\/]node_modules[\\/]reka-ui[\\/]/],
|
||||
['ui-utils', /[\\/]node_modules[\\/](@internationalized|@floating-ui|@vueuse|@iconify)[\\/]/],
|
||||
]
|
||||
|
||||
export function vendorChunk(id: string): string | undefined {
|
||||
for (const [name, pattern] of groups) {
|
||||
if (pattern.test(id)) return name
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
Reference in new issue
Block a user