Skip to content

Commit

Permalink
Always include entry point but user can exclude it by checking isEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
wille committed Aug 16, 2024
1 parent f709da6 commit 4ea6ba5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ function getChunks(

const chunks = collectChunksFromManifest(manifest, chunkId);

if (!includeEntrypoint) {
chunks.delete('index.html');
// TODO properly include <script module>
}

const assets = new Map<string, Module>();

for (const chunk of chunks.values()) {
Expand All @@ -197,6 +192,7 @@ function getChunks(
type: 'stylesheet',
href: cssFile,
comment: `Stylesheed imported by ${moduleId}`,
isEntry: chunk.isEntry,
});
}
}
Expand All @@ -213,6 +209,7 @@ function getChunks(
type: 'modulepreload',
href: chunk.file,
comment: `Chunk imported by ${moduleId}`,
isEntry: chunk.isEntry,
});
}

Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface Module {
type: 'stylesheet' | 'modulepreload' | 'module';
href: string;
comment?: string;
isEntry?: boolean;
}

export function createHtmlTag({ type, href, comment }: Module) {
Expand Down

0 comments on commit 4ea6ba5

Please sign in to comment.