Skip to content

Allow import of directories with index.ts and import of files without extension #1198

@Fuzzyma

Description

@Fuzzyma

Desired Behavior

This should work

import {a, b, c} from './alphabet' // same as '/alphabet/index.{ts,js,mjs,cjs}'
import {a} from './alphabet/a' // same as '/alphabet/a.{ts,js,mjs,cjs}'

Is this request related to a problem?

I am using ts-node together with vite. Vite natively supports typescript and imports as requested.
I would like to share code on both client and server but the client side code uses directory imports and imports without file extension. So it wont run.

Alternatives you've considered

I tried to use --experimental-specifier-resolution=node but it doenst seem to work together with a loader (which makes sense).

If someone has a quickfix for me, that would also do the trick for now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions