mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## 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
7 lines
96 B
JavaScript
7 lines
96 B
JavaScript
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
const nextConfig = {}
|
|
|
|
module.exports = nextConfig
|