22 lines
714 B
TypeScript
22 lines
714 B
TypeScript
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
|
|
}
|