Using ES6 modules, I know I can alias a named import:
import { foo as bar } from 'my-module';
And I know I can import a default import:
import defaultMember from 'my-module';
I'd like to alias a default import and I had thought the following would work:
import defaultMember as alias from 'my-module';
But that results in a parsing (syntax) error.
How can I (or can I?) alias a default import?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…