Skip to content

Commit

Permalink
feat(manifest): include dynamic entries and dynamic imports (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xb4lint committed Jan 20, 2021
1 parent 2bc1f22 commit 9ed4908
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vite/src/node/plugins/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export function manifestPlugin(config: ResolvedConfig): Plugin {
string,
{
file: string
imports?: string[]
imports?: string[],
dynamicImports?: string[]
}
> = {}

Expand All @@ -18,14 +19,15 @@ export function manifestPlugin(config: ResolvedConfig): Plugin {
for (const file in bundle) {
const chunk = bundle[file]
if (chunk.type === 'chunk') {
if (chunk.isEntry) {
if (chunk.isEntry || chunk.isDynamicEntry) {
const name =
format === 'system' && !chunk.name.includes('-legacy')
? chunk.name + '-legacy'
: chunk.name
manifest[name + '.js'] = {
file: chunk.fileName,
imports: chunk.imports
imports: chunk.imports,
dynamicImports: chunk.dynamicImports
}
}
} else if (chunk.name) {
Expand Down

0 comments on commit 9ed4908

Please sign in to comment.