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,884
  • 3
  • 18
  • 35

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,669
  • 1
  • 29
  • 54
1

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

export * from 'myJavaScriptFile.js';
Bergi
  • 630,263
  • 148
  • 957
  • 1,375