// alias.config.cjs
const path = require('path');
const config = {
resolve: {
alias: {
lib: path.join(__dirname, 'lib'),
},
},
};
module.exports = config;
node --import alias-register ./main.js
If you only need to add TypeScript support in a Module context, you can use the ESM loader:
node --import alias-register/esm ./main.js
node --loader alias-register/esm ./main.js
If you only need to add TypeScript & ESM support in a CommonJS context, you can use the CJS loader:
node --require alias-register/cjs ./main.js