0

Is there something like:

export * as * from 'myJavaScriptFile.js' 

I seem to want

"A way to export all variables which are exported from a file to be re-exported from another file - not with a new reference but whatever reference it was exported in the first place"

NOT like below: because there is a new reference(allStuff)

import default, * as allStuff from 'myJavaScriptFile.js';
export { allStuff };
takrishna
  • 4,710
  • 2
  • 16
  • 33

2 Answers2

2

you're looking for this:

export * from './typescript-file';
export * from './javascript-file';

This will re-export everything exported from that file

This is typically used in barrel files (index.ts)

Thatkookooguy
  • 6,267
  • 1
  • 28
  • 52
1

You'd just use a star export - without as keyword:

export * from 'myJavaScriptFile.js';
Bergi
  • 572,313
  • 128
  • 898
  • 1,281