From 1962bc67d4b56ed53b50105575923047dd0c4941 Mon Sep 17 00:00:00 2001 From: Boshen <1430279+Boshen@users.noreply.github.com> Date: Fri, 25 Apr 2025 08:39:56 +0000 Subject: [PATCH] feat(transformer_plugins): split out `oxc_transformer_plugins` crate (#10617) --- Cargo.lock | 29 +++++++++-- Cargo.toml | 1 + crates/oxc/Cargo.toml | 8 +-- crates/oxc/src/compiler.rs | 5 +- crates/oxc/src/lib.rs | 10 ++++ crates/oxc_transformer/Cargo.toml | 3 -- crates/oxc_transformer/src/lib.rs | 2 - .../oxc_transformer/src/utils/ast_builder.rs | 11 ---- .../tests/integrations/main.rs | 1 - .../tests/integrations/plugins/mod.rs | 2 - crates/oxc_transformer_plugins/Cargo.toml | 46 ++++++++++++++++ .../src}/inject_global_variables.rs | 0 .../src/lib.rs} | 0 .../src}/module_runner_transform.rs | 52 ++++++++++++++----- .../src}/replace_global_defines.rs | 0 .../integrations}/inject_global_variables.rs | 7 +-- .../tests/integrations/main.rs | 16 ++++++ .../integrations}/replace_global_defines.rs | 2 +- ...eplace_global_defines__test_sourcemap.snap | 0 ...eplace_global_defines__test_sourcemap.snap | 22 ++++++++ napi/transform/src/transformer.rs | 9 ++-- tasks/minsize/Cargo.toml | 2 +- tasks/minsize/src/lib.rs | 2 +- 23 files changed, 179 insertions(+), 51 deletions(-) delete mode 100644 crates/oxc_transformer/tests/integrations/plugins/mod.rs create mode 100644 crates/oxc_transformer_plugins/Cargo.toml rename crates/{oxc_transformer/src/plugins => oxc_transformer_plugins/src}/inject_global_variables.rs (100%) rename crates/{oxc_transformer/src/plugins/mod.rs => oxc_transformer_plugins/src/lib.rs} (100%) rename crates/{oxc_transformer/src/plugins => oxc_transformer_plugins/src}/module_runner_transform.rs (98%) rename crates/{oxc_transformer/src/plugins => oxc_transformer_plugins/src}/replace_global_defines.rs (100%) rename crates/{oxc_transformer/tests/integrations/plugins => oxc_transformer_plugins/tests/integrations}/inject_global_variables.rs (97%) create mode 100644 crates/oxc_transformer_plugins/tests/integrations/main.rs rename crates/{oxc_transformer/tests/integrations/plugins => oxc_transformer_plugins/tests/integrations}/replace_global_defines.rs (99%) rename crates/{oxc_transformer/tests/integrations/plugins => oxc_transformer_plugins/tests/integrations}/snapshots/integrations__plugins__replace_global_defines__test_sourcemap.snap (100%) create mode 100644 crates/oxc_transformer_plugins/tests/integrations/snapshots/integrations__replace_global_defines__test_sourcemap.snap diff --git a/Cargo.lock b/Cargo.lock index b428383b12164..5a84a0c9864b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1514,6 +1514,7 @@ dependencies = [ "oxc_span", "oxc_syntax", "oxc_transformer", + "oxc_transformer_plugins", ] [[package]] @@ -1955,7 +1956,7 @@ dependencies = [ "oxc_semantic", "oxc_span", "oxc_tasks_common", - "oxc_transformer", + "oxc_transformer_plugins", "rustc-hash", "similar-asserts", ] @@ -2226,16 +2227,38 @@ dependencies = [ "oxc_parser", "oxc_regular_expression", "oxc_semantic", - "oxc_sourcemap", "oxc_span", "oxc_syntax", - "oxc_tasks_common", "oxc_traverse", "pico-args", "rustc-hash", "serde", "serde_json", "sha1", +] + +[[package]] +name = "oxc_transformer_plugins" +version = "0.66.0" +dependencies = [ + "cow-utils", + "insta", + "itoa", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_parser", + "oxc_semantic", + "oxc_sourcemap", + "oxc_span", + "oxc_syntax", + "oxc_tasks_common", + "oxc_transformer", + "oxc_traverse", + "rustc-hash", "similar", ] diff --git a/Cargo.toml b/Cargo.toml index 97a6371bc6489..f71697306c842 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,6 +127,7 @@ oxc_span = { version = "0.66.0", path = "crates/oxc_span" } oxc_syntax = { version = "0.66.0", path = "crates/oxc_syntax" } oxc_transform_napi = { version = "0.66.0", path = "napi/transform" } oxc_transformer = { version = "0.66.0", path = "crates/oxc_transformer" } +oxc_transformer_plugins = { version = "0.66.0", path = "crates/oxc_transformer_plugins" } oxc_traverse = { version = "0.66.0", path = "crates/oxc_traverse" } # publish = false diff --git a/crates/oxc/Cargo.toml b/crates/oxc/Cargo.toml index 864f2219e11ef..8a838327a2e9e 100644 --- a/crates/oxc/Cargo.toml +++ b/crates/oxc/Cargo.toml @@ -28,9 +28,6 @@ required-features = ["full"] [dependencies] oxc_allocator = { workspace = true } oxc_ast = { workspace = true } -oxc_parser = { workspace = true, features = [] } -oxc_regular_expression = { workspace = true, optional = true } - oxc_ast_visit = { workspace = true, optional = true } oxc_cfg = { workspace = true, optional = true } oxc_codegen = { workspace = true, optional = true } @@ -38,10 +35,13 @@ oxc_diagnostics = { workspace = true } oxc_isolated_declarations = { workspace = true, optional = true } oxc_mangler = { workspace = true, optional = true } oxc_minifier = { workspace = true, optional = true } +oxc_parser = { workspace = true, features = [] } +oxc_regular_expression = { workspace = true, optional = true } oxc_semantic = { workspace = true, optional = true } oxc_span = { workspace = true } oxc_syntax = { workspace = true } oxc_transformer = { workspace = true, optional = true } +oxc_transformer_plugins = { workspace = true, optional = true } [features] default = ["regular_expression"] @@ -59,7 +59,7 @@ full = [ ] semantic = ["oxc_semantic"] -transformer = ["oxc_transformer"] +transformer = ["oxc_transformer", "oxc_transformer_plugins"] minifier = ["oxc_mangler", "oxc_minifier"] codegen = ["oxc_codegen"] mangler = ["oxc_mangler"] diff --git a/crates/oxc/src/compiler.rs b/crates/oxc/src/compiler.rs index f979660efa208..dc9dc68d9fd89 100644 --- a/crates/oxc/src/compiler.rs +++ b/crates/oxc/src/compiler.rs @@ -10,9 +10,10 @@ use oxc_minifier::{CompressOptions, Compressor}; use oxc_parser::{ParseOptions, Parser, ParserReturn}; use oxc_semantic::{Scoping, SemanticBuilder, SemanticBuilderReturn}; use oxc_span::SourceType; -use oxc_transformer::{ +use oxc_transformer::{TransformOptions, Transformer, TransformerReturn}; +use oxc_transformer_plugins::{ InjectGlobalVariables, InjectGlobalVariablesConfig, ReplaceGlobalDefines, - ReplaceGlobalDefinesConfig, TransformOptions, Transformer, TransformerReturn, + ReplaceGlobalDefinesConfig, }; #[derive(Default)] diff --git a/crates/oxc/src/lib.rs b/crates/oxc/src/lib.rs index 8f4c600daee0a..986039ee47e82 100644 --- a/crates/oxc/src/lib.rs +++ b/crates/oxc/src/lib.rs @@ -80,6 +80,16 @@ pub mod transformer { pub use oxc_transformer::*; } +#[cfg(feature = "transformer")] +pub mod transformer_plugins { + //! Transformer/Transpiler + //! + //! See the [`oxc_transformer_plugins` module-level documentation](oxc_transformer_plugins) for more + //! information. + #[doc(inline)] + pub use oxc_transformer_plugins::*; +} + #[cfg(feature = "minifier")] pub mod minifier { //! Source code minifier. diff --git a/crates/oxc_transformer/Cargo.toml b/crates/oxc_transformer/Cargo.toml index 3c59a8f617c02..45bc8ba5a68d4 100644 --- a/crates/oxc_transformer/Cargo.toml +++ b/crates/oxc_transformer/Cargo.toml @@ -49,7 +49,4 @@ sha1 = { workspace = true } insta = { workspace = true } oxc_codegen = { workspace = true } oxc_parser = { workspace = true } -oxc_sourcemap = { workspace = true } -oxc_tasks_common = { workspace = true } pico-args = { workspace = true } -similar = { workspace = true } diff --git a/crates/oxc_transformer/src/lib.rs b/crates/oxc_transformer/src/lib.rs index 4b6ecb40f5d06..df34094fd6be9 100644 --- a/crates/oxc_transformer/src/lib.rs +++ b/crates/oxc_transformer/src/lib.rs @@ -36,7 +36,6 @@ mod regexp; mod typescript; mod decorator; -mod plugins; use common::Common; use context::TransformCtx; @@ -72,7 +71,6 @@ pub use crate::{ ESTarget, Engine, EngineTargets, EnvOptions, Module, TransformOptions, babel::{BabelEnvOptions, BabelOptions}, }, - plugins::*, proposals::ProposalOptions, typescript::{RewriteExtensionsMode, TypeScriptOptions}, }; diff --git a/crates/oxc_transformer/src/utils/ast_builder.rs b/crates/oxc_transformer/src/utils/ast_builder.rs index 688ac3ecd36b4..5f84ec2007522 100644 --- a/crates/oxc_transformer/src/utils/ast_builder.rs +++ b/crates/oxc_transformer/src/utils/ast_builder.rs @@ -91,14 +91,3 @@ pub fn create_property_access<'a>( let property = ctx.ast.identifier_name(SPAN, ctx.ast.atom(property)); Expression::from(ctx.ast.member_expression_static(span, object, property, false)) } - -/// `object` -> `object['a']`. -pub fn create_compute_property_access<'a>( - span: Span, - object: Expression<'a>, - property: &str, - ctx: &TraverseCtx<'a>, -) -> Expression<'a> { - let expression = ctx.ast.expression_string_literal(SPAN, ctx.ast.atom(property), None); - Expression::from(ctx.ast.member_expression_computed(span, object, expression, false)) -} diff --git a/crates/oxc_transformer/tests/integrations/main.rs b/crates/oxc_transformer/tests/integrations/main.rs index 854e4aa83208e..b383af58caaf0 100644 --- a/crates/oxc_transformer/tests/integrations/main.rs +++ b/crates/oxc_transformer/tests/integrations/main.rs @@ -1,5 +1,4 @@ mod es_target; -mod plugins; mod targets; use std::path::Path; diff --git a/crates/oxc_transformer/tests/integrations/plugins/mod.rs b/crates/oxc_transformer/tests/integrations/plugins/mod.rs deleted file mode 100644 index f43e90253926e..0000000000000 --- a/crates/oxc_transformer/tests/integrations/plugins/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod inject_global_variables; -mod replace_global_defines; diff --git a/crates/oxc_transformer_plugins/Cargo.toml b/crates/oxc_transformer_plugins/Cargo.toml new file mode 100644 index 0000000000000..c79102cc589c7 --- /dev/null +++ b/crates/oxc_transformer_plugins/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "oxc_transformer_plugins" +version = "0.66.0" +authors.workspace = true +categories.workspace = true +edition.workspace = true +homepage.workspace = true +include = ["/examples", "/src"] +keywords.workspace = true +license.workspace = true +publish = true +repository.workspace = true +rust-version.workspace = true +description.workspace = true + +[lints] +workspace = true + +[lib] +test = true +doctest = false + +[dependencies] +cow-utils = { workspace = true } +itoa = { workspace = true } +oxc_allocator = { workspace = true } +oxc_ast = { workspace = true } +oxc_ast_visit = { workspace = true } +oxc_diagnostics = { workspace = true } +oxc_ecmascript = { workspace = true } +oxc_parser = { workspace = true } +oxc_semantic = { workspace = true } +oxc_span = { workspace = true } +oxc_syntax = { workspace = true, features = ["to_js_string"] } +oxc_transformer = { workspace = true } +oxc_traverse = { workspace = true } +rustc-hash = { workspace = true } + +[dev-dependencies] +insta = { workspace = true } +oxc_codegen = { workspace = true } +oxc_parser = { workspace = true } +oxc_sourcemap = { workspace = true } +oxc_tasks_common = { workspace = true } +oxc_transformer = { workspace = true } +similar = { workspace = true } diff --git a/crates/oxc_transformer/src/plugins/inject_global_variables.rs b/crates/oxc_transformer_plugins/src/inject_global_variables.rs similarity index 100% rename from crates/oxc_transformer/src/plugins/inject_global_variables.rs rename to crates/oxc_transformer_plugins/src/inject_global_variables.rs diff --git a/crates/oxc_transformer/src/plugins/mod.rs b/crates/oxc_transformer_plugins/src/lib.rs similarity index 100% rename from crates/oxc_transformer/src/plugins/mod.rs rename to crates/oxc_transformer_plugins/src/lib.rs diff --git a/crates/oxc_transformer/src/plugins/module_runner_transform.rs b/crates/oxc_transformer_plugins/src/module_runner_transform.rs similarity index 98% rename from crates/oxc_transformer/src/plugins/module_runner_transform.rs rename to crates/oxc_transformer_plugins/src/module_runner_transform.rs index cd7c6851dd9db..42dfdbcb723d9 100644 --- a/crates/oxc_transformer/src/plugins/module_runner_transform.rs +++ b/crates/oxc_transformer_plugins/src/module_runner_transform.rs @@ -58,10 +58,6 @@ use oxc_span::SPAN; use oxc_syntax::identifier::is_identifier_name; use oxc_traverse::{Ancestor, BoundIdentifier, Traverse, TraverseCtx, traverse_mut}; -use crate::utils::ast_builder::{ - create_compute_property_access, create_member_callee, create_property_access, -}; - #[derive(Debug, Default)] pub struct ModuleRunnerTransform<'a> { /// Uid for generating import binding names. @@ -814,11 +810,42 @@ impl<'a> ModuleRunnerTransform<'a> { } } +/// `object` -> `object['a']`. +fn create_compute_property_access<'a>( + span: Span, + object: Expression<'a>, + property: &str, + ctx: &TraverseCtx<'a>, +) -> Expression<'a> { + let expression = ctx.ast.expression_string_literal(SPAN, ctx.ast.atom(property), None); + Expression::from(ctx.ast.member_expression_computed(span, object, expression, false)) +} + +/// `object` -> `object.call`. +pub fn create_member_callee<'a>( + object: Expression<'a>, + property: &'static str, + ctx: &TraverseCtx<'a>, +) -> Expression<'a> { + let property = ctx.ast.identifier_name(SPAN, Atom::from(property)); + Expression::from(ctx.ast.member_expression_static(SPAN, object, property, false)) +} + +/// `object` -> `object.a`. +pub fn create_property_access<'a>( + span: Span, + object: Expression<'a>, + property: &str, + ctx: &TraverseCtx<'a>, +) -> Expression<'a> { + let property = ctx.ast.identifier_name(SPAN, ctx.ast.atom(property)); + Expression::from(ctx.ast.member_expression_static(span, object, property, false)) +} + #[cfg(test)] mod test { use std::path::Path; - use oxc_ast::AstBuilder; use rustc_hash::FxHashSet; use similar::TextDiff; @@ -829,9 +856,7 @@ mod test { use oxc_semantic::SemanticBuilder; use oxc_span::SourceType; use oxc_tasks_common::print_diff_in_terminal; - use oxc_traverse::traverse_mut; - - use crate::{JsxOptions, JsxRuntime, TransformOptions, context::TransformCtx, jsx::Jsx}; + use oxc_transformer::{JsxRuntime, TransformOptions, Transformer}; use super::ModuleRunnerTransform; @@ -848,12 +873,11 @@ mod test { let mut program = ret.program; let mut scoping = SemanticBuilder::new().build(&program).semantic.into_scoping(); if is_jsx { - let mut jsx_options = JsxOptions::enable(); - jsx_options.runtime = JsxRuntime::Classic; - jsx_options.jsx_plugin = true; - let ctx = TransformCtx::new(Path::new(""), &TransformOptions::default()); - let mut jsx = Jsx::new(jsx_options, None, AstBuilder::new(&allocator), &ctx); - scoping = traverse_mut(&mut jsx, &allocator, &mut program, scoping); + let mut options = TransformOptions::default(); + options.jsx.runtime = JsxRuntime::Classic; + let ret = Transformer::new(&allocator, Path::new(""), &options) + .build_with_scoping(scoping, &mut program); + scoping = ret.scoping; } let (deps, dynamic_deps) = ModuleRunnerTransform::new().transform(&allocator, &mut program, scoping); diff --git a/crates/oxc_transformer/src/plugins/replace_global_defines.rs b/crates/oxc_transformer_plugins/src/replace_global_defines.rs similarity index 100% rename from crates/oxc_transformer/src/plugins/replace_global_defines.rs rename to crates/oxc_transformer_plugins/src/replace_global_defines.rs diff --git a/crates/oxc_transformer/tests/integrations/plugins/inject_global_variables.rs b/crates/oxc_transformer_plugins/tests/integrations/inject_global_variables.rs similarity index 97% rename from crates/oxc_transformer/tests/integrations/plugins/inject_global_variables.rs rename to crates/oxc_transformer_plugins/tests/integrations/inject_global_variables.rs index 45ed4e26c095c..4c9b9209db30f 100644 --- a/crates/oxc_transformer/tests/integrations/plugins/inject_global_variables.rs +++ b/crates/oxc_transformer_plugins/tests/integrations/inject_global_variables.rs @@ -7,11 +7,12 @@ use oxc_codegen::{CodeGenerator, CodegenOptions}; use oxc_parser::Parser; use oxc_semantic::SemanticBuilder; use oxc_span::SourceType; -use oxc_transformer::{InjectGlobalVariables, InjectGlobalVariablesConfig, InjectImport}; -use crate::codegen; +use oxc_transformer_plugins::{InjectGlobalVariables, InjectGlobalVariablesConfig, InjectImport}; -pub fn test(source_text: &str, expected: &str, config: InjectGlobalVariablesConfig) { +use super::codegen; + +fn test(source_text: &str, expected: &str, config: InjectGlobalVariablesConfig) { let source_type = SourceType::default(); let allocator = Allocator::default(); let ret = Parser::new(&allocator, source_text, source_type).parse(); diff --git a/crates/oxc_transformer_plugins/tests/integrations/main.rs b/crates/oxc_transformer_plugins/tests/integrations/main.rs new file mode 100644 index 0000000000000..507d2b5b2d6f3 --- /dev/null +++ b/crates/oxc_transformer_plugins/tests/integrations/main.rs @@ -0,0 +1,16 @@ +mod inject_global_variables; +mod replace_global_defines; + +use oxc_allocator::Allocator; +use oxc_codegen::{CodeGenerator, CodegenOptions}; +use oxc_parser::Parser; +use oxc_span::SourceType; + +pub fn codegen(source_text: &str, source_type: SourceType) -> String { + let allocator = Allocator::default(); + let ret = Parser::new(&allocator, source_text, source_type).parse(); + CodeGenerator::new() + .with_options(CodegenOptions { single_quote: true, ..CodegenOptions::default() }) + .build(&ret.program) + .code +} diff --git a/crates/oxc_transformer/tests/integrations/plugins/replace_global_defines.rs b/crates/oxc_transformer_plugins/tests/integrations/replace_global_defines.rs similarity index 99% rename from crates/oxc_transformer/tests/integrations/plugins/replace_global_defines.rs rename to crates/oxc_transformer_plugins/tests/integrations/replace_global_defines.rs index 4ca43e3b9ca68..657bf17e7552a 100644 --- a/crates/oxc_transformer/tests/integrations/plugins/replace_global_defines.rs +++ b/crates/oxc_transformer_plugins/tests/integrations/replace_global_defines.rs @@ -3,7 +3,7 @@ use oxc_codegen::{CodeGenerator, CodegenOptions}; use oxc_parser::Parser; use oxc_semantic::SemanticBuilder; use oxc_span::SourceType; -use oxc_transformer::{ReplaceGlobalDefines, ReplaceGlobalDefinesConfig}; +use oxc_transformer_plugins::{ReplaceGlobalDefines, ReplaceGlobalDefinesConfig}; use crate::codegen; diff --git a/crates/oxc_transformer/tests/integrations/plugins/snapshots/integrations__plugins__replace_global_defines__test_sourcemap.snap b/crates/oxc_transformer_plugins/tests/integrations/snapshots/integrations__plugins__replace_global_defines__test_sourcemap.snap similarity index 100% rename from crates/oxc_transformer/tests/integrations/plugins/snapshots/integrations__plugins__replace_global_defines__test_sourcemap.snap rename to crates/oxc_transformer_plugins/tests/integrations/snapshots/integrations__plugins__replace_global_defines__test_sourcemap.snap diff --git a/crates/oxc_transformer_plugins/tests/integrations/snapshots/integrations__replace_global_defines__test_sourcemap.snap b/crates/oxc_transformer_plugins/tests/integrations/snapshots/integrations__replace_global_defines__test_sourcemap.snap new file mode 100644 index 0000000000000..4afd585ccd8dd --- /dev/null +++ b/crates/oxc_transformer_plugins/tests/integrations/snapshots/integrations__replace_global_defines__test_sourcemap.snap @@ -0,0 +1,22 @@ +--- +source: crates/oxc_transformer_plugins/tests/integrations/replace_global_defines.rs +expression: snapshot +--- +- test.js.map +(0:0) "1;\n" --> (0:0) "1;\n" +(1:0) "__OBJECT__;\n" --> (1:0) "({ 'hello': 'test' });\n" +(2:0) "2;\n" --> (2:0) "2;\n" +(3:0) "__STRING__;\n" --> (3:0) "'development';\n" +(4:0) "3;\n" --> (4:0) "3;\n" +(5:0) "log(__OBJECT__)" --> (5:0) "log({ 'hello': 'test' })" +(5:15) ";\n" --> (5:24) ";\n" +(6:0) "4;\n" --> (6:0) "4;\n" +(7:0) "log(__STRING__)" --> (7:0) "log('development')" +(7:15) ";\n" --> (7:18) ";\n" +(8:0) "5;\n" --> (8:0) "5;\n" +(9:0) "__OBJECT__." --> (9:0) "({ 'hello': 'test' })." +(9:11) "hello;\n" --> (9:22) "hello;\n" +(10:0) "6;\n" --> (10:0) "6;\n" +(11:0) "log(__MEMBER__)" --> (11:0) "log(xx.yy.zz)" +(11:15) ";\n" --> (11:13) ";\n" +(12:0) "7;\n" --> (12:0) "7;\n" diff --git a/napi/transform/src/transformer.rs b/napi/transform/src/transformer.rs index 03b9dbe1ba6cf..a93f043eac218 100644 --- a/napi/transform/src/transformer.rs +++ b/napi/transform/src/transformer.rs @@ -19,9 +19,12 @@ use oxc::{ semantic::{SemanticBuilder, SemanticBuilderReturn}, span::SourceType, transformer::{ - EnvOptions, HelperLoaderMode, HelperLoaderOptions, InjectGlobalVariablesConfig, - InjectImport, JsxRuntime, ModuleRunnerTransform, ProposalOptions, - ReplaceGlobalDefinesConfig, RewriteExtensionsMode, + EnvOptions, HelperLoaderMode, HelperLoaderOptions, JsxRuntime, ProposalOptions, + RewriteExtensionsMode, + }, + transformer_plugins::{ + InjectGlobalVariablesConfig, InjectImport, ModuleRunnerTransform, + ReplaceGlobalDefinesConfig, }, }; use oxc_napi::OxcError; diff --git a/tasks/minsize/Cargo.toml b/tasks/minsize/Cargo.toml index 5a39fe439d403..a53e144d578c1 100644 --- a/tasks/minsize/Cargo.toml +++ b/tasks/minsize/Cargo.toml @@ -24,7 +24,7 @@ oxc_minifier = { workspace = true } oxc_parser = { workspace = true } oxc_semantic = { workspace = true } oxc_span = { workspace = true } -oxc_transformer = { workspace = true } +oxc_transformer_plugins = { workspace = true } flate2 = { workspace = true } oxc_tasks_common = { workspace = true } diff --git a/tasks/minsize/src/lib.rs b/tasks/minsize/src/lib.rs index e4fb3848935f5..cd0b0b77d5a41 100644 --- a/tasks/minsize/src/lib.rs +++ b/tasks/minsize/src/lib.rs @@ -17,7 +17,7 @@ use oxc_parser::Parser; use oxc_semantic::SemanticBuilder; use oxc_span::SourceType; use oxc_tasks_common::{TestFile, TestFiles, project_root}; -use oxc_transformer::{ReplaceGlobalDefines, ReplaceGlobalDefinesConfig}; +use oxc_transformer_plugins::{ReplaceGlobalDefines, ReplaceGlobalDefinesConfig}; use rustc_hash::FxHashMap; #[test]