Closed utricularian closed 3 years ago
This is a part of ESM
module system: default export makes it impossible to use ESM tree shaking. See https://github.com/railsware/js-routes/blob/master/VERSION_2_UPGRADE.md for more info.
I've added a note that typescript definitions are only capable with ESM module type in Readme. Not much else I can do at the moment.
Prior to the Typescript update (which is awesome), I was able to consume my routes file like this:
import Routes from 'config/backendRoutes'
Converting the file to Typescript, I now get:
"export 'default' (imported as 'Routes') was not found in 'file/that/was/generated'
I can get around this by doing the following:
import * as Routes from 'config/backendRoutes'
Is it possible to add a default export in the
.d.ts
file?