Skip to content

ESM strict imports mode option to moduleResolution bundlerΒ #63381

@paztis

Description

@paztis

πŸ” Search Terms

moduleResolution bundler esm imports

βœ… Viability Checklist

⭐ Suggestion

Add an option to enforce imports with file extension when the module is iESM (type: module) and moduleResolution is bundler.

πŸ“ƒ Motivating Example

For now in bundler moduleResolution, typescript is tolerent.
But when we develop a library, we have no idea of the strictness of the bundler (webpack is strict for example).
We need a way to enforce the imports with file extension in case the module is ESM

A dedicated option in the tsconfig can resolve it that we will enable or not

πŸ’» Use Cases

  1. What do you want to use this for?
  2. What shortcomings exist with current approaches?
  3. What workarounds are you using in the meantime?

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