That feeling when you are looking out for two days and find it like this: just remove .js
from "main": "dist/index.js"
in package.json
and everything works fine!
"main": "dist/index",
UPD: this answer relative if you have your own npm package, if not – see my answer below.
And if above answer not resolved import your module, try just add typings
in package.json
:
"main": "dist/index",
"typings": "dist/index",
Of course, here folder dist
– it’s where stores your module’s files.