Why can’t I import a default export with “import … as” with BabelJS

You can import the default export by either

import Test2 from './test';

or

import {default as Test2} from './test';

The default export doesn’t have Test as a name that you would need to alias – you just need to import the default under the name that you want.

The best docs I’ve found so far is the article ECMAScript 6 modules: the final syntax in Axel Rauschmayers blog.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)