docusaurus
docusaurus copied to clipboard
Wechaty Ecosystem is moving towards to ES Modules
We have decided to use ES Modules by default for all Wechaty projects, are working hard to refactoring all NPM modules from the Wechaty ecosystem from CommJS to ESM. See:
- https://github.com/Chatie/tsconfig/issues/16
For now, the Wechaty Getting Started has been already switched to ES Module mode, which means:
- We must use ESM to import module:
import { Module } from 'module' - The
requirewill not be supported anymore. (will through a Node.js error if use it with ESM)
For our tech writers, we need to:
- Always use
import { Module } from 'module'in our new docs - Replace the
require('module')in old docs withimportsyntax whenever we see it
We will also replace all the contents from our blogs as well, which will be a huge project and we will do it later.