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

ci(benchmark/transformer): enable all > es6 plugins #5324

Merged
Merged
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
14 changes: 12 additions & 2 deletions tasks/benchmark/benches/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use oxc_parser::{Parser, ParserReturn};
use oxc_semantic::SemanticBuilder;
use oxc_span::SourceType;
use oxc_tasks_common::TestFiles;
use oxc_transformer::{TransformOptions, Transformer};
use oxc_transformer::{EnvOptions, Targets, TransformOptions, Transformer};

fn bench_transformer(criterion: &mut Criterion) {
let mut group = criterion.benchmark_group("transformer");
Expand Down Expand Up @@ -41,7 +41,17 @@ fn bench_transformer(criterion: &mut Criterion) {
let trivias_copy = trivias.clone();

runner.run(|| {
let transform_options = TransformOptions::default();
let env_options = EnvOptions {
// >= ES2016
targets: Targets::from_query("chrome 51"),
..Default::default()
};
let mut transform_options =
TransformOptions::from_preset_env(&env_options).unwrap();

// Enable React related plugins
transform_options.react.development = true;

let ret = Transformer::new(
&allocator,
Path::new(&file.file_name),
Expand Down