Skip to content

Conversation

@industral
Copy link

Assume we have

import myModule from 'awesomeModule';

and in tsconfig-esm.json

    "baseUrl": ".",
    "paths": {
      "awesomeModule": ["./node_modules/awesomeModule/dist/esm/index.js"]
    }

and in tsconfig-cjs.json

    "baseUrl": ".",
    "paths": {
      "awesomeModule": ["./node_modules/awesomeModule/dist/cjs/index.js"]
    }

In that case, it should resolve as awesomeModule/dist/cjs/index.js and awesomeModule/dist/esm/index.js respectively. But currently, it resolved as relative paths, and fails, as import statement made from source code, and now it's in dist folder, which make relative paths broken, e.g. Error: Cannot find module <PATH>/dist/node_modules/awesomeModule/dist/esm/index.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant