Skip to content

Commit

Permalink
feat(turbopack): add missing webpack context property (#7617)
Browse files Browse the repository at this point in the history
### Description


https://vercel.slack.com/archives/C03EWR7LGEN/p1709598188040829?thread_ts=1709595370.496449&cid=C03EWR7LGEN

One of the loader uses context's `_module` property, puts an empty one
to avoid runtime exception at least.

Closes PACK-2656
  • Loading branch information
kwonoj authored Mar 7, 2024
1 parent f44516e commit 8045b05
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/turbopack-node/js/src/transforms/webpack-loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ const transform = (
{
resource,
context: {
_module: {
// For debugging purpose, if someone find context is not full compatible to
// webpack they can guess this comes from turbopack
__reserved: "TurbopackContext",
},
currentTraceSpan: new DummySpan(),
rootContext: contextDir,
getOptions() {
Expand Down

0 comments on commit 8045b05

Please sign in to comment.