Skip to content

Commit

Permalink
馃攣: fix transform meta for static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
merryman committed Jun 4, 2024
1 parent fe1561c commit 8a99cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lively.source-transform/capturing.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function transformImportMeta (parsed, options) {
if (node.type == 'MetaProperty' && node.meta.name == 'import') {
return options.classToFunction.currentModuleAccessor
? nodes.objectLiteral(['url', nodes.member(options.classToFunction.currentModuleAccessor, 'id')])
: parse('({url: eval("_context").id})').body[0].expression;
: parse('({url: eval("typeof _context !== \'undefined\' ? _context : {}").id})').body[0].expression;
}
return node;
});
Expand Down

0 comments on commit 8a99cf5

Please sign in to comment.