Skip to content

should support TS, TSX, JS, JSX in same directory #173

Closed

Description

@mavericken

Currently plugin-typescript can only handle one file extension per directory via SystemJS's default extension configuration. The typescript compiler, on the other hand, will try multiple extensions until it finds the file. I feel that plugin-typescript's capabilities should match the capabilities of the standard typescript compiler, so we should also check for other extensions when we fail to find the file.

I have made a pull request that can do what I am proposing: #172

Activity

  1. mavericken commented on Oct 31, 2016

    @mavericken
    ContributorAuthor

    My solution was helpful, but after using it this afternoon I found it to be incomplete, so I closed the pull request. Nonetheless I think the issue is still valid.

    Edit: I made some improvements and made a new pull request: #176
    It provides a configurable way to fall back to other file extensions if the one attempted is not resolvable. So you can add the option fileExtensions: ["ts","tsx"], and if you ask it for filename.ts, and it does not exist, but filename.tsx exists, it will grab filename.tsx. This way you can have both file types in a single directory, like with the normal typescript compiler.

  2. mavericken commented on Dec 20, 2016

    @mavericken
    ContributorAuthor

    I made a separate module which will take care of this, which can be used in conjunction with plugin-typescript.
    https://www.npmjs.com/package/one-plugin

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions