1
0
Fork 0

remove: unexported Rollup bundle utils

This commit is contained in:
ssube 2021-08-01 09:47:34 -05:00
parent 9b08a21fa9
commit e18f65a049
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 0 additions and 34 deletions

View File

@ -1,34 +0,0 @@
import { sep } from 'path';
export interface ChunkMatch {
includes: Array<string>;
match: Array<string>;
}
export type ChunkMap = Record<string, ChunkMatch>;
export function fixPath(name: string): string {
return name.replace('/', sep);
}
export function chunkMap(map: ChunkMap, name: string): string {
for (const [chunk, def] of Object.entries(map)) {
for (const include of def.includes) {
if (name.includes(include)) {
return chunk;
}
}
for (const match of def.match) {
if (name.match(match)) {
return chunk;
}
}
}
if (name.length === 30 && name.match(/^[a-f0-9]+$/)) {
return 'vendor';
}
return 'unknown';
}