mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
84edd37d0a
## Add support for require.context in Turbopack This PR adds support for `require.context` in Turbopack, allowing dynamic imports of files from a directory structure. The implementation includes: - Fixed a bug in the `require_context.rs` file where the wrong variable was being used (`root_val` instead of `dir_val`) - Simplified code in `RequireContextMap` implementation with pattern matching - Added e2e tests to verify `require.context` works correctly with regex filtering - Added a snapshot test for `require.context` functionality - Created test files to validate the implementation against expected behavior The PR includes a commented-out test for `require.context` without regex filtering, which will be enabled once Turbopack fully supports this feature. Addresses: [PACK-4323](https://linear.app/vercel/issue/PACK-4323/requirecontext-behaves-differently-in-turbopack-than-in-webpack) Fixes #78019
9 lines
174 B
TypeScript
9 lines
174 B
TypeScript
import { ReactNode } from 'react'
|
|
export default function Root({ children }: { children: ReactNode }) {
|
|
return (
|
|
<html>
|
|
<body>{children}</body>
|
|
</html>
|
|
)
|
|
}
|