#Removing file extensions on import

1 messages · Page 1 of 1 (latest)

elfin kindle
#

Is there a deno.json configuration to make so that the file extensions are not needed when importing stuff?
Deno should have enough context when importing files (unless they have the same name), so it makes sense to me

tribal carbon
#

you can use the --unstable-sloppy-imports flag; we dont recommend to do this unless really needed (ie moving over a node project)

elfin kindle
#

meh, I just generated a the project

#

.tsx? it is then

#

wait, why is that unstable?

tribal carbon
#

because we want people to avoid using it

elfin kindle
#

what, why?

#

is there any major problems on it?

tribal carbon
elfin kindle
#

still a bit lost on it, but it's something you just accept, ig

river bluff
#

and some unnecessary overhead

lean grove
#

Sorry to necro bump here.

I have configured an import map to import a local, non distributed node package (designed for npm context, we are just prototyping new apps with Deno).

The import is to a barrel export that does not have file extensions on all t he exports.

It looks like this:

export * from './src/types/modelTypes'
export * from './src/answers'
export * from './src/changelogs'
...

It looks like the Deno language server cannot properly resolve these imports without attaching the .ts extension to each of the barrel exports.

This is not an option for us as this package is being used elsewhere and should not be modified for this particular use.

How can I make the Deno language server correctly resolve this import?