From c96e2408f4190c05d7ef5f9dbf86225724aebc46 Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Fri, 27 Jun 2025 14:05:43 +0800 Subject: [PATCH] docs: modify ESM and CJS mdx component --- website/docs/en/guide/basic/output-format.mdx | 4 ++-- website/docs/en/guide/start/glossary.mdx | 4 ++-- website/docs/en/shared/components/CJS.mdx | 2 +- website/docs/en/shared/components/ESM.mdx | 2 +- website/docs/zh/guide/basic/output-format.mdx | 4 ++-- website/docs/zh/guide/start/glossary.mdx | 4 ++-- website/docs/zh/shared/components/CJS.mdx | 2 +- website/docs/zh/shared/components/ESM.mdx | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/website/docs/en/guide/basic/output-format.mdx b/website/docs/en/guide/basic/output-format.mdx index f8c0feafb..e35a7796f 100644 --- a/website/docs/en/guide/basic/output-format.mdx +++ b/website/docs/en/guide/basic/output-format.mdx @@ -13,9 +13,9 @@ Library authors need to carefully consider which module formats to support. Let' ### What are ESM and CJS? -- **ESM**: ESM is +- **ESM**: -- **CommonJS**: [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules) is +- **CommonJS**: ### What is the dilemma of ESM / CJS diff --git a/website/docs/en/guide/start/glossary.mdx b/website/docs/en/guide/start/glossary.mdx index e618ebb54..27e29cd70 100644 --- a/website/docs/en/guide/start/glossary.mdx +++ b/website/docs/en/guide/start/glossary.mdx @@ -7,11 +7,11 @@ import MF from '../../shared/components/MF.mdx'; ## ESM -ESM stands for ECMAScript Modules, + ## CJS -CJS stands for [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules), + ## UMD diff --git a/website/docs/en/shared/components/CJS.mdx b/website/docs/en/shared/components/CJS.mdx index 6914198b9..8ce26880a 100644 --- a/website/docs/en/shared/components/CJS.mdx +++ b/website/docs/en/shared/components/CJS.mdx @@ -1 +1 @@ -a module system used in JavaScript, particularly in server-side environments like Node.js. It was created to allow JavaScript to be used outside of the browser by providing a way to manage modules and dependencies. +CJS stands for [CommonJS modules](https://nodejs.org/api/modules.html#modules-commonjs-modules), which is a module system used in JavaScript, particularly in server-side environments like Node.js. It was created to allow JavaScript to be used outside of the browser by providing a way to manage modules and dependencies. diff --git a/website/docs/en/shared/components/ESM.mdx b/website/docs/en/shared/components/ESM.mdx index 8774f4bc9..2987df2f0 100644 --- a/website/docs/en/shared/components/ESM.mdx +++ b/website/docs/en/shared/components/ESM.mdx @@ -1 +1 @@ -a modern module system introduced in ES2015 that allows JavaScript code to be organized into reusable, self-contained modules. ESM is now the standard for both [browser](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and [Node.js](https://nodejs.org/api/esm.html) environments, replacing older module systems like [CommonJS (CJS)](https://nodejs.org/api/modules.html) and [AMD](https://requirejs.org/docs/whyamd.html). +ESM stands for [ECMAScript modules](https://nodejs.org/api/esm.html#modules-ecmascript-modules), which is a modern module system introduced in ES2015 that allows JavaScript code to be organized into reusable, self-contained modules. ESM is now the standard for both [browser](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and [Node.js](https://nodejs.org/api/esm.html) environments, replacing older module systems like [CommonJS (CJS)](https://nodejs.org/api/modules.html) and [AMD](https://requirejs.org/docs/whyamd.html). diff --git a/website/docs/zh/guide/basic/output-format.mdx b/website/docs/zh/guide/basic/output-format.mdx index c117d89d3..6ae0439dc 100644 --- a/website/docs/zh/guide/basic/output-format.mdx +++ b/website/docs/zh/guide/basic/output-format.mdx @@ -13,9 +13,9 @@ Rslib 支持多种 JavaScript 文件的输出格式:[ESM](#esm--cjs)、[CJS](# ### 什么是 ESM 和 CJS? -- **ESM**: ESM 是 +- **ESM**: -- **CommonJS**: [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules) 是 +- **CommonJS**: ### ESM 和 CJS 的困境 diff --git a/website/docs/zh/guide/start/glossary.mdx b/website/docs/zh/guide/start/glossary.mdx index 381e22549..e667e2b32 100644 --- a/website/docs/zh/guide/start/glossary.mdx +++ b/website/docs/zh/guide/start/glossary.mdx @@ -7,11 +7,11 @@ import MF from '../../shared/components/MF.mdx'; ## ESM -ESM 代表 ECMAScript 模块, + ## CJS -CJS 代表 [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules), + ## UMD diff --git a/website/docs/zh/shared/components/CJS.mdx b/website/docs/zh/shared/components/CJS.mdx index 04eff4c33..ce312ce57 100644 --- a/website/docs/zh/shared/components/CJS.mdx +++ b/website/docs/zh/shared/components/CJS.mdx @@ -1 +1 @@ -一种在 JavaScript 中使用的模块系统,特别是在像 Node.js 这样的服务器端环境中。它的诞生是为了通过提供一种管理模块和依赖项的方法,允许 JavaScript 在浏览器之外使用。 +CJS 代表 [CommonJS modules](https://nodejs.org/api/modules.html#modules-commonjs-modules),这是一种在 JavaScript 中使用的模块系统,特别是在像 Node.js 这样的服务器端环境中。它的诞生是为了通过提供一种管理模块和依赖项的方法,允许 JavaScript 在浏览器之外使用。 diff --git a/website/docs/zh/shared/components/ESM.mdx b/website/docs/zh/shared/components/ESM.mdx index 4e0737576..10f7fb344 100644 --- a/website/docs/zh/shared/components/ESM.mdx +++ b/website/docs/zh/shared/components/ESM.mdx @@ -1 +1 @@ -一种在 ES2015 中引入的现代模块系统,允许将 JavaScript 代码组织成可重用的、自包含的模块。ESM 现在是 [浏览器](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Modules) 和 [Node.js](https://nodejs.org/api/esm.html) 环境的标准,取代了旧的模块系统,如 [CommonJS (CJS)](https://nodejs.org/api/modules.html) 和 [AMD](https://requirejs.org/docs/whyamd.html)。 +ESM 代表 [ECMAScript modules](https://nodejs.org/api/esm.html#modules-ecmascript-modules),这是一种在 ES2015 中引入的现代模块系统,允许将 JavaScript 代码组织成可重用的、自包含的模块。ESM 现在是 [浏览器](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Modules) 和 [Node.js](https://nodejs.org/api/esm.html) 环境的标准,取代了旧的模块系统,如 [CommonJS (CJS)](https://nodejs.org/api/modules.html) 和 [AMD](https://requirejs.org/docs/whyamd.html)。