Files
Donny/강동윤andGitHub 29d53c87ea feat(next-swc): Pass names of side-effect-free packages (#63268)
### What?

Pass the names of side-effect-free packages specified in `experimental.optimizePackageImports`.

Turbopack counterpart: https://github.com/vercel/turbo/pull/7731

### Why?

Some packages like `@tremor/react` causes a problem without `optimizePackageImports`.

### How?

Closes PACK-2527
2024-03-29 06:28:48 +00:00

28 lines
680 B
TypeScript

import { join } from 'path'
import { createNextDescribe } from 'e2e-utils'
import { hasRedbox } from 'next-test-utils'
createNextDescribe(
'optimizePackageImports - mui',
{
env: {
NEXT_TEST_MODE: '1',
},
files: join(__dirname, 'fixture-tremor'),
dependencies: {
'@headlessui/react': '^1.7.18',
'@headlessui/tailwindcss': '^0.2.0',
'@remixicon/react': '^4.2.0',
'@tremor/react': '^3.14.1',
},
},
({ next }) => {
it('should work', async () => {
// Without barrel optimization, the reproduction breaks.
const browser = await next.browser('/')
expect(await hasRedbox(browser)).toBe(false)
})
}
)