🔍 Search Terms
import types global
✅ Viability Checklist
⭐ Suggestion
In browser environemnt you often need to load librarys, wich are developed as ESM modules ans with ESM types globaly, cause they are only delivered as CJS, for example typescript, see: #57010
There should be a way, so I can import typescript and use it, without loading the library (like import type), but there should be no error if I use instances from the import.
for example at the moment it is like this:
import type ts form 'typescript'
const a = ts.SyntaxKind.TaggedTemplateExpression
will error cause the import is only imported as type
maybe something like this:
import global type ts form 'typescript'
const a = ts.SyntaxKind.TaggedTemplateExpression
or
import global ts form 'typescript'
const a = ts.SyntaxKind.TaggedTemplateExpression
would be possible?
🔍 Search Terms
import types global
✅ Viability Checklist
⭐ Suggestion
In browser environemnt you often need to load librarys, wich are developed as ESM modules ans with ESM types globaly, cause they are only delivered as CJS, for example typescript, see: #57010
There should be a way, so I can import typescript and use it, without loading the library (like import type), but there should be no error if I use instances from the import.
for example at the moment it is like this:
will error cause the import is only imported as type
maybe something like this:
or
would be possible?