docusaurus icon indicating copy to clipboard operation
docusaurus copied to clipboard

Wechaty Ecosystem is moving towards to ES Modules

Open huan opened this issue 4 years ago • 0 comments

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:

  1. We must use ESM to import module: import { Module } from 'module'
  2. The require will not be supported anymore. (will through a Node.js error if use it with ESM)

For our tech writers, we need to:

  1. Always use import { Module } from 'module' in our new docs
  2. Replace the require('module') in old docs with import syntax 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.

huan avatar Sep 09 '21 10:09 huan