Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon for sample many modules in benchmarks + reliability fixes #2777

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions crates/next-dev/benches/bundlers/webpack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl Bundler for Webpack {
&[
NpmPackage::new("@pmmmwh/react-refresh-webpack-plugin", "^0.5.7"),
NpmPackage::new("@swc/core", "^1.2.249"),
NpmPackage::new("@swc/helpers", "^0.4.13"),
NpmPackage::new("react-refresh", "^0.14.0"),
NpmPackage::new("swc-loader", "^0.2.3"),
NpmPackage::new("webpack", "^5.75.0"),
Expand Down
Loading