Skip to content

Commit

Permalink
Sample many modules in benchmarks + reliability fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkirsz committed Nov 17, 2022
1 parent 9192202 commit 05ca8ac
Show file tree
Hide file tree
Showing 12 changed files with 561 additions and 375 deletions.
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/next-dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ fs_extra = "1.2.0"
lazy_static = "1.4.0"
once_cell = "1.13.0"
parking_lot = "0.12.1"
rand = "0.8.5"
regex = "1.6.0"
tempfile = "3.3.0"
test-generator = "0.3.0"
Expand Down
11 changes: 6 additions & 5 deletions crates/next-dev/benches/bundlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use self::{
vite::Vite,
webpack::Webpack,
};
use crate::util::env::read_env;

mod nextjs;
mod parcel;
Expand Down Expand Up @@ -59,16 +60,16 @@ pub trait Bundler {
}

pub fn get_bundlers() -> Vec<Box<dyn Bundler>> {
let config = std::env::var("TURBOPACK_BENCH_BUNDLERS").ok();
let config: String = read_env("TURBOPACK_BENCH_BUNDLERS", String::from("turbopack")).unwrap();
let mut turbopack = false;
let mut others = false;
match config.as_deref() {
Some("all") => {
match config.as_ref() {
"all" => {
turbopack = true;
others = true
}
Some("others") => others = true,
None | Some("") => {
"others" => others = true,
"turbopack" => {
turbopack = true;
}
_ => panic!("Invalid value for TURBOPACK_BENCH_BUNDLERS"),
Expand Down
2 changes: 1 addition & 1 deletion crates/next-dev/benches/bundlers/vite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Bundler for Vite {
fn prepare(&self, install_dir: &Path) -> Result<()> {
let mut packages = vec![NpmPackage::new("vite", "^3.2.4")];
if self.swc {
packages.push(NpmPackage::new("vite-plugin-swc-react-refresh", "^2.2.0"));
packages.push(NpmPackage::new("vite-plugin-swc-react-refresh", "^2.2.1"));
} else {
packages.push(NpmPackage::new("@vitejs/plugin-react", "^2.2.0"));
};
Expand Down
Loading

0 comments on commit 05ca8ac

Please sign in to comment.