swc_ecma_transforms_module::common_js

Function lazy_require

source
pub fn lazy_require(
    expr: Expr,
    mod_ident: Ident,
    var_kind: VarDeclKind,
) -> FnDecl
Expand description
function foo() {
  const data = expr;

  foo = () => data;

  return data;
}