mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What * Remove the change added in #64467, but still kept tests. * Add more tests for mixed imports (component and function) from shared component with `optimizePackageImports` ### Why The fix in #64467 was not correct, as mixing `export *` with `"use client"` should error if Next.js detect it properly. When there's mixed exports, that a shared function will become a client reference if the target file inherits the client boundary. The original issue #64467 fixed was actually related to tree-shaking, which is fixed in #64681. Closes NEXT-3197
22 lines
644 B
TypeScript
22 lines
644 B
TypeScript
import { createNextDescribe } from 'e2e-utils'
|
|
|
|
describe('Skipped in Turbopack', () => {
|
|
createNextDescribe(
|
|
'app-dir - optimizePackageImports - basic',
|
|
{
|
|
files: __dirname,
|
|
},
|
|
({ next }) => {
|
|
it('should build successfully', async () => {
|
|
const $ = await next.render$('/')
|
|
expect(await $('#client-mod').text()).toContain('client:default')
|
|
})
|
|
|
|
it('should handle mixed imports from barrel optimized lib correctly', async () => {
|
|
const $ = await next.render$('/mixed-barrel-imports')
|
|
expect(await $('#component').attr('style')).toContain('color:blue')
|
|
})
|
|
}
|
|
)
|
|
})
|