@@ -11,10 +11,9 @@ import { join_relative } from '../../utils/filesystem.js';
1111 * build_data: import('types').BuildData;
1212 * relative_path: string;
1313 * routes: import('types').RouteData[];
14- * format?: 'esm' | 'cjs'
1514 * }} opts
1615 */
17- export function generate_manifest ( { build_data, relative_path, routes, format = 'esm' } ) {
16+ export function generate_manifest ( { build_data, relative_path, routes } ) {
1817/**
1918 * @type {Map<any, number> } The new index of each node in the filtered nodes array
2019 */
@@ -55,13 +54,7 @@ export function generate_manifest({ build_data, relative_path, routes, format =
5554} ) ;
5655
5756/** @type {(path: string) => string } */
58- const load =
59- format === 'esm'
60- ? ( path ) => `import('${ path } ')`
61- : ( path ) => `Promise.resolve().then(() => require('${ path } '))` ;
62-
63- /** @type {(path: string) => string } */
64- const loader = ( path ) => `() => ${ load ( path ) } ` ;
57+ const loader = ( path ) => `() => import('${ path } ')` ;
6558
6659const assets = build_data . manifest_data . assets . map ( ( asset ) => asset . file ) ;
6760if ( build_data . service_worker ) {
@@ -115,7 +108,7 @@ export function generate_manifest({ build_data, relative_path, routes, format =
115108} ) . filter ( Boolean ) . join ( ',\n\t\t\t\t' ) }
116109],
117110matchers: async () => {
118- ${ Array . from ( matchers ) . map ( type => `const { match: ${ type } } = await ${ load ( join_relative ( relative_path , `/entries/matchers/${ type } .js` ) ) } ` ) . join ( '\n\t\t\t\t' ) }
111+ ${ Array . from ( matchers ) . map ( type => `const { match: ${ type } } = await import (' ${ ( join_relative ( relative_path , `/entries/matchers/${ type } .js` ) ) } ') ` ) . join ( '\n\t\t\t\t' ) }
119112return { ${ Array . from ( matchers ) . join ( ', ' ) } };
120113}
121114}
0 commit comments