Skip to content

require.resolve will still resolve to a JavaScript file #2013

Closed

Description

@VictorQueiroz

If you run node using --require ts-node/register and compile your TypeScript project, require.resolve calls will resolve to the compiled .js files and not .ts. Is there any known solutions to this besides deleting the .js files?

Activity

  1. cspotcode commented on May 8, 2023

    @cspotcode
    Collaborator

    preferTsExts should do the trick

  2. locked and limited conversation to collaborators on May 8, 2023
  3. converted this issue into a discussion #2016 on May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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