alloc / alloc/saus

Reduce duplication in client routes map

未關閉
#75 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
backlog enhancement
主要語言
TypeScript
星號
38
分支
1
PR 合併指標
30 天內沒有已合併 PR

描述

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?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。