hot-import
hot-import copied to clipboard
Prepare to ESM support
Link to https://github.com/Chatie/tsconfig/issues/16
Hot Import in ESM
We can use import('module-name?timestamp=${Date.now()}')
to reload the module.
However, we are facing the problem that: CJS & ESM code are not compatible in the Node.js level, which means that it will be very complicated if we want to make them work together.
For example, we can use export
to export totally different codes for CJS & ESM, which means we will maintain two code bases for the different module systems.
Conclusion
I decided to give it up for now. (Aug 27, 2021)