0

I have a folder of utils which has an index.js file. To simplify utils usage throughout my app I am exporting everything in index.js.

So far I have been re-exporting only named modules like this:

export * from './Constants';
export { TIME } from './Time';

Is it possible to export a default as named? This results in a syntax error:

export default as { Constants } from './Constants';

mancristiana
  • 1,896
  • 3
  • 18
  • 28

1 Answers1

0

You could do:

import * as Constants from './Constants';
const c = Constant.default;
export { c as Constant };

Here is a little plunkr demonstrating it : https://plnkr.co/edit/3WqzFQg33BG0iruD

ben
  • 3,558
  • 1
  • 15
  • 28