Turbopack: Fix webpack loaders if source file exists in an additional root (#100744)
The webpack runner needs to compute the absolute path to the loader
implementation, and it cannot compute it relative to the cwd if we're
using additional roots.
Adds this struct:
```
/// An argument passed to the evaluated JavaScript.
#[turbo_tasks::task_input]
#[derive(Clone, Hash, Debug, PartialEq, Eq, Encode, Decode)]
pub enum EvaluateArg {
Vc(ResolvedVc<JsonValue>),
/// Passed as a string: A path relative to [`EvaluateContext::cwd`] when both are on the same
/// filesystem, otherwise an absolute system path (e.g. for an additional root).
///
/// This is converted when the evaluation runs, so that machine-specific system paths aren't
/// stored in task inputs or cells.
Path(FileSystemPath),
}
```
The `Path` variant allows us to defer conversion to an absolute system
path until after we've crossed the turbo-tasks boundary, right before we
call the webpack loader.
Showing
Please
register
or
sign in
to comment