I need to resolve the location of a module in my sandbox, and I need to resolve it like if it was an ESM module (i.e. respecting the conditional exports). I'm trying to use import.meta.resolve like this:
But I get this error: SyntaxError: Cannot use 'import.meta' outside a module
Is there any way to use the import resolver inside vm2 (I know that import is not supported, but I'm only trying to resolve a dependency, not importing it)
I need to resolve the location of a module in my sandbox, and I need to resolve it like if it was an ESM module (i.e. respecting the conditional exports). I'm trying to use import.meta.resolve like this:
But I get this error:
SyntaxError: Cannot use 'import.meta' outside a module
Is there any way to use the import resolver inside vm2 (I know that
import
is not supported, but I'm only trying to resolve a dependency, not importing it)