Add a test case for #48583.
This commit is contained in:
parent
acd3b25ef5
commit
ebddbf1b00
5 changed files with 28 additions and 0 deletions
|
@ -263,6 +263,8 @@ export class ClientReferenceManifestPlugin {
|
|||
// It's possible that a chunk also emits CSS files, that will
|
||||
// be handled separatedly.
|
||||
if (!file.endsWith('.js')) return null
|
||||
if (file.endsWith('.hot-update.js')) return null
|
||||
|
||||
return requiredChunk.id + ':' + file
|
||||
})
|
||||
})
|
||||
|
|
5
test/e2e/app-dir/dynamic/app/chunk-loading/comp.js
Normal file
5
test/e2e/app-dir/dynamic/app/chunk-loading/comp.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
'use client'
|
||||
|
||||
export default function () {
|
||||
return <h1>hello</h1>
|
||||
}
|
11
test/e2e/app-dir/dynamic/app/chunk-loading/page.js
Normal file
11
test/e2e/app-dir/dynamic/app/chunk-loading/page.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
// This file is needed for the test, to ensure that the "comp.js" module is
|
||||
// created as a dynamic import chunk.
|
||||
|
||||
'use client'
|
||||
|
||||
export default function Page() {
|
||||
import('./comp').then((m) => {
|
||||
console.log(m)
|
||||
})
|
||||
return null
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
import Comp from '../comp'
|
||||
|
||||
export default function Page() {
|
||||
return <Comp />
|
||||
}
|
|
@ -52,5 +52,10 @@ createNextDescribe(
|
|||
await browser.elementByCss('#css-text-dynamic-no-ssr-client').text()
|
||||
).toBe('next-dynamic dynamic no ssr on client:suffix')
|
||||
})
|
||||
|
||||
it('should generate correct client manifest for dynamic chunks', async () => {
|
||||
const $ = await next.render$('/chunk-loading/server')
|
||||
expect($('h1').text()).toBe('hello')
|
||||
})
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue