| use turbo_tasks::{ResolvedVc, Vc}; | |
| use turbo_tasks_env::ProcessEnv; | |
| use turbo_tasks_fs::FileSystemPath; | |
| use turbopack_core::chunk::ChunkingContext; | |
| pub struct ExecutionContext { | |
| pub project_path: FileSystemPath, | |
| pub chunking_context: ResolvedVc<Box<dyn ChunkingContext>>, | |
| pub env: ResolvedVc<Box<dyn ProcessEnv>>, | |
| } | |
| impl ExecutionContext { | |
| pub fn new( | |
| project_path: FileSystemPath, | |
| chunking_context: ResolvedVc<Box<dyn ChunkingContext>>, | |
| env: ResolvedVc<Box<dyn ProcessEnv>>, | |
| ) -> Vc<Self> { | |
| ExecutionContext { | |
| project_path, | |
| chunking_context, | |
| env, | |
| } | |
| .cell() | |
| } | |
| pub fn project_path(&self) -> Vc<FileSystemPath> { | |
| self.project_path.clone().cell() | |
| } | |
| pub fn chunking_context(&self) -> Vc<Box<dyn ChunkingContext>> { | |
| *self.chunking_context | |
| } | |
| pub fn env(&self) -> Vc<Box<dyn ProcessEnv>> { | |
| *self.env | |
| } | |
| } | |