ecmascript 6 - How can I alias a default import in Javascript? -


using es6 modules, know can alias named import

import { foo bar } 'my-module'; 

and know can import default import

import defaultmember 'my-module'; 

i'd alias default import , had thought following work

import defaultmember alias 'my-module'; 

but results in parsing (syntax) error.

how can (or can i?) alias default import?

defaultmember is alias - doesn't need name of exported function/thing. do

import alias 'my-module'; 

alternatively can do

import {default alias} 'my-module'; 

but that's rather esoteric.


Comments