Skip to content

Commit

Permalink
bench: add symlink fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jul 9, 2024
1 parent 176dc45 commit 4a78c0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cache-key: benchmark
save-cache: ${{ github.ref_name == 'main' }}
tools: cargo-codspeed

- uses: ./.github/actions/pnpm
- name: Build Benchmark
run: cargo codspeed build --features codspeed

Expand Down
10 changes: 8 additions & 2 deletions benches/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use rayon::prelude::*;

fn data() -> Vec<(PathBuf, &'static str)> {
let cwd = env::current_dir().unwrap().join("fixtures/enhanced_resolve");
let current_dir = env::current_dir().unwrap();
let cwd = current_dir.join("fixtures/enhanced_resolve");
let pnpm = current_dir.join("fixtures/pnpm");
let f = cwd.join("test/fixtures");
vec![
(cwd.clone(), "./"),
Expand Down Expand Up @@ -50,6 +52,10 @@ fn data() -> Vec<(PathBuf, &'static str)> {
(cwd.clone(), "rrr"),
(cwd.clone(), "@"),
(cwd, "@@@"),
// symlink
(pnpm.clone(), "axios"),
(pnpm.clone(), "styled-components"),
(pnpm.clone(), "postcss"),
]
}

Expand All @@ -58,7 +64,7 @@ fn oxc_resolver() -> oxc_resolver::Resolver {
let alias_value = AliasValue::from("./");
Resolver::new(ResolveOptions {
extensions: vec![".ts".into(), ".js".into()],
condition_names: vec!["webpack".into()],
condition_names: vec!["webpack".into(), "require".into()],
alias_fields: vec![vec!["browser".into()]],
extension_alias: vec![
(".js".into(), vec![".ts".into(), ".js".into()]),
Expand Down

0 comments on commit 4a78c0d

Please sign in to comment.