<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Commonjs on Commentary of Takao</title><link>https://takao.blog/zh-tw/tags/commonjs/</link><description>Recent content in Commonjs on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><copyright>Commentary of Takao</copyright><lastBuildDate>Wed, 15 Jul 2026 22:01:08 +0900</lastBuildDate><atom:link href="https://takao.blog/zh-tw/tags/commonjs/index.xml" rel="self" type="application/rss+xml"/><item><title>Node.js 對需要 ESM 模組的穩定支持</title><link>https://takao.blog/zh-tw/web/node-esm-require-support-stable/</link><pubDate>Wed, 05 Nov 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/node-esm-require-support-stable/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/node-esm-require-support-stable-zh-tw.png" alt="Featured image of post Node.js 對需要 ESM 模組的穩定支持" /&gt;&lt;h2 id="nodejs-對需要-esm-模組的穩定支持"&gt;Node.js 對需要 ESM 模組的穩定支持
&lt;/h2&gt;&lt;p&gt;多年來，Node.js 開發人員面臨著痛苦的分歧：&lt;strong&gt;CommonJS&lt;/strong&gt; (CJS) 和 &lt;strong&gt;ES 模組&lt;/strong&gt; (ESM) 共存，但互通性有限。 CJS 程式碼可以非同步載入 &lt;code&gt;import()&lt;/code&gt; ESM 模組，但 &lt;code&gt;require()&lt;/code&gt;（CJS 核心的同步載入機制）根本無法載入 ESM。這迫使程式碼庫遷移成為要么全有要么全無的事情。&lt;/p&gt;</description></item></channel></rss>