alloc / alloc/saus

Reduce duplication in client routes map

Đang mở
#75 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
backlog enhancement
Ngôn ngữ chính
TypeScript
Star
38
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

https://github.com/novemberborn/common-path-prefix/blob/master/index.js

If multiple routes have the same route module, we can avoid duplication in client routes map.

```ts
// Before
export default {
"default": "/assets/entry.8ae2ce2d.js",
"/": "/assets/entry.8ae2ce2d.js",
"/about": "/assets/entry.ba4aa235.js",
}

// After
import {buildRouteMap} from '/@id/saus/src/client/helpers.ts'
export default buildRouteMap({
"/assets/entry.": {
"8ae2ce2d.js": ["default", "/"],
"ba4aa235.js": ["/about"],
},
})
```

The exported object would look the same as before, but the paths would be deduplicated.

**Q:** Does gzip make this a non-problem?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.