mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Closes PACK-4263 This: - Adds support for using `config.turbopack` for Turbopack. The accepted value for this option is identical to the previous experimental one without the deprecated field `loaders`. - Deprecates `config.experimental.turbo`. Warns on its use, but will continue to accept it, merging it with `config.turbopack` while preferring fields on `config.turbopack`. - also see https://github.com/vercel/next.js/pull/77850#pullrequestreview-2749738760 Test Plan: - [x] Convert use of `config.experimental.turbo` in tests to `config.turbopack` - [x] Automated test for accepting the experimental option for compatibility, as well as the config merging
47 lines
960 B
TypeScript
47 lines
960 B
TypeScript
/* eslint-env jest */
|
|
|
|
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
const nextConfig = {
|
|
turbopack: {
|
|
resolveAlias: {
|
|
'/*': './*',
|
|
'~*': '*',
|
|
},
|
|
},
|
|
}
|
|
|
|
describe.each([
|
|
{ dependencies: { sass: '1.54.0' }, nextConfig },
|
|
{
|
|
dependencies: { 'sass-embedded': '1.75.0' },
|
|
nextConfig: {
|
|
...nextConfig,
|
|
sassOptions: {
|
|
implementation: 'sass-embedded',
|
|
},
|
|
},
|
|
},
|
|
])(
|
|
'Good CSS Import from node_modules with tilde ($dependencies)',
|
|
({ dependencies, nextConfig }) => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
dependencies: {
|
|
...dependencies,
|
|
nprogress: '0.2.0',
|
|
},
|
|
nextConfig,
|
|
})
|
|
|
|
it('should render the page', async () => {
|
|
const browser = await next.browser('/')
|
|
expect(
|
|
await browser
|
|
.elementByCss('#nprogress .bar')
|
|
.getComputedCss('background-color')
|
|
).toBe('rgb(34, 153, 221)')
|
|
})
|
|
}
|
|
)
|