wds is unable to resolve imports that use exports
in node when importing from an .ts
file.
The following import will resolve into /node_modules/nodemod/dist/lib/prismjs.ts
instead.
// src/main.ts
import { highlight } from 'nodemod/dist/lib/prismjs.js';
The following import should resolve into /node_modules/nodemod/dist/lib/prismjs.js
.
// src/main.ts
import { highlight } from 'nodemod/dist/lib/prismjs.js';
- Run
npm start
- Visit
localhost:8000
with Dev Tools open - Inspect network tab on the resources
- Notice how
nodemod/dist/lib/prismjs.js
gets resolved using.ts
instead of.js
main2.js
demonstrates how the import works correctly
- Notice how