Skip to content

Relative path '.' is transpiled to package.json main field #415

@juzerzarif

Description

@juzerzarif

I have a directory structure as follows:

src/some/directory
├── SomeModule.js
└── index.js

And I have a main field specified in my package.json: "main": "src/main.js". If I have a relative import of index.js in SomeModule.js, it gets transpiled to the main field from the package.json.

import utils from '.'; // gets transpiled to '../../main'
import utils from './'; // works

Will try to look into where the resolution is coming from a bit more after work today.

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