Skip to content

Commit

Permalink
refactor lazy asset to lazy graph content source (vercel/turborepo#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra authored Aug 1, 2022
1 parent 178cc9f commit fe3bc76
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions crates/next-dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ use turbopack_core::{
},
context::AssetContextVc,
environment::{BrowserEnvironment, EnvironmentIntention, EnvironmentVc, ExecutionEnvironment},
lazy::LazyAssetVc,
source_asset::SourceAssetVc,
};
use turbopack_dev_server::{
fs::DevServerFileSystemVc,
html::DevHtmlAsset,
source::{asset_graph::AssetGraphContentSource, router::RouterContentSource},
source::{asset_graph::AssetGraphContentSourceVc, router::RouterContentSource},
DevServerVc,
};

Expand Down Expand Up @@ -137,14 +136,11 @@ async fn main() {
));
};

let mut served_asset = entry_asset;
if !args.eager_compile {
served_asset = LazyAssetVc::new(served_asset).into();
}

let graph = AssetGraphContentSource {
root_asset: served_asset,
root_path: FileSystemPathVc::new(dev_server_fs, ""),
let root_path = FileSystemPathVc::new(dev_server_fs, "");
let graph = if args.eager_compile {
AssetGraphContentSourceVc::new_eager(root_path, entry_asset)
} else {
AssetGraphContentSourceVc::new_lazy(root_path, entry_asset)
}
.into();
let viz = TurboTasksSource {
Expand Down

0 comments on commit fe3bc76

Please sign in to comment.