I have a project using node.js v16, and more and more npm libs are not anymore compatible with require, and need to be used with import.
Until now i was using package.json to have my root directory as alias
// package.json
"dependencies": {
"~src": "file:.",
}
And in my source code
const someCode = require('~src/absolute/path/someCode');
This is not working with import, and with tests i made, i haven't found any solution to make it works with import.
Have you already met that kind of problem ? And found a solution about it ?