Skip to content

Commit

Permalink
Add doc comment for contextual imports visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeLane committed Jan 21, 2025
1 parent 4608bfa commit 5b11fdf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/atlaspack_contextual_imports/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ pub struct ContextualImportsConfig {
pub default_if_undefined: bool,
}

/// Transform contextual imports usages into inline requires
///
/// This visitor is used to transform `importCond` into compliant ES syntax that is safe to use without bundler features `require('x')`
/// We will need this for cases where the bundler is not available (like jest or node environments) or when we want to rollout `importCond`
/// behaviour safely, by replicating naive source code
pub struct ContextualImportsInlineRequireVisitor {
unresolved_mark: Mark,
config: ContextualImportsConfig,
Expand Down

0 comments on commit 5b11fdf

Please sign in to comment.