Skip to content

Doesn't work with esm ? #99

@gbkwiatt

Description

@gbkwiatt

I just wanted to use it with my nodejs 14x app.
I run my node with esm module for ES6 support.

require('module-alias/register')
import logger from '_root/logger'

and packages.json

  "_moduleAliases": {
    "_root": "."
   }

And I keep getting error Cannot find module '_root/logger'
Tried with different combinations of directories and names always same result.
Is it because I run my app with node -r esm -r dotenv/config server.js esm ?

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