silverwolf-x/project / packages /next /src /server /normalizers /built /pages /pages-bundle-path-normalizer.ts
silverwolf-x's picture
download
raw
1.11 kB
import { normalizePagePath } from '../../../../shared/lib/page-path/normalize-page-path'
import type { Normalizer } from '../../normalizer'
import { Normalizers } from '../../normalizers'
import { PrefixingNormalizer } from '../../prefixing-normalizer'
import { wrapNormalizerFn } from '../../wrap-normalizer-fn'
export class PagesBundlePathNormalizer extends Normalizers {
constructor() {
super([
// The bundle path should have the trailing `/index` stripped from
// it.
wrapNormalizerFn(normalizePagePath),
// The page should prefixed with `pages/`.
new PrefixingNormalizer('pages'),
])
}
public normalize(page: string): string {
return super.normalize(page)
}
}
export class DevPagesBundlePathNormalizer extends Normalizers {
constructor(pagesNormalizer: Normalizer) {
super([
// This should normalize the filename to a page.
pagesNormalizer,
// Normalize the app page to a pathname.
new PagesBundlePathNormalizer(),
])
}
public normalize(filename: string): string {
return super.normalize(filename)
}
}

Xet Storage Details

Size:
1.11 kB
·
Xet hash:
7016cfc7406ba8d5407d12e1be3ffe7c5fd752ccd1c4375bdabdd35f407412f0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.