With some adjustment we don’t need babel and transpiling.
Just Node.js. Up and running !
First of all, add type: module
into your package.json
Here we go to fix the error.
The module need to be the exact name.
It also makes sense to set this. Some reason behind this is that the module might guess wrong when you have .js
and .ts
in the same directory.
After migration, the __dirname
is not working anymore.
Here are the alternative:
Sometimes, there are lib that’s not yet compatible with ‘Named import’
Sometimes, there are the mixin style required
For example, winston-daily-rotate-file
this one mutate the imported winston
instance.
Here we go. Now we finish migrating.
Cheers !