Skip to content

import self issue bug  #648

Description

@bluelovers

file

./strtable.ts

import * as self from './strtable';
export default self;
console.log(__filename, require.extensions);

cli

ts-node strtable.ts

output

Expected behavior

should only once , even if .js exists

strtable.ts {
  '.ts': [Function],
  '.tsx': [Function],
  '.js': [Function],
  '.json': [Function],
  '.node': [Function] }

Actual behavior:

will load self x2 ( .js + .ts )

strtable.js { '.js': [Function],
  '.json': [Function],
  '.node': [Function],
  '.ts': [Function],
  '.tsx': [Function] }

strtable.ts { '.js': [Function],
  '.json': [Function],
  '.node': [Function],
  '.ts': [Function],
  '.tsx': [Function] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions