So I know imports can be replaced with require
.
import {x} from 'x'
is equivalent to const {x} = require('x')
.
But what about import * from 'x'
? the only thing that I can imagine it being translated to is with(require('x')){... }
.
Yet with
statements are frown upon, aren't they? (because you don't know in compile time how a reference will be resolved)