Skip to content

Resolution of JS files is not working as expected when using API #23564

Closed
@alan-agius4

Description

@alan-agius4

TypeScript Version: 2.8.3

Search Terms:
index resolution
resolution

Code

index.js

export * from "./test"

test/index.js

export const x = "hello";

Transpile code;

const ts = require("typescript");

const options = { module: ts.ModuleKind.AMD, target: ts.ScriptTarget.ES5, allowJs: true, outDir: "out" };
const host = ts.createCompilerHost(options);
const program = ts.createProgram(["index.js"], options, host);
program.emit();

Expected behavior:
both files get emitted and downleveled

Actual behavior:
test/index.js is not resolved and only the root index.js is being transpiled, when using the API to downlevel some JS files. If I change the export to export * from "./test/index" all files are being transpiled.

Related Issues:
ng-packagr/ng-packagr#784

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