Skip to content

[Compiler Options] Account for allowJs compiler option #316

@dschnare

Description

@dschnare

Currently, even though the allowJs compiler option has been defined in a tsconfig.json or via the ts.compilerOptions config, JavaScript modules will not be found. I have resolved this issue, at least for my needs, by changing line 95 in index.ts.

Original: const scriptRegex = /\.tsx?$/i;
Changed: const scriptRegex = /\.[jt]sx?$/i;

I haven't ran into any issues yet. If anyone has time to fully test this use case out. I would greatly appreciate your efforts. I currently don't have time to dig into this for a few weeks. There may other cases in the source code where the file extension match needs to take into account the allowJs option as well.

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