canirequire

canirequireCommonJS › antd

Is antd ESM-only? Can you require() it?

An enterprise-class UI design language and React components implementation

Last verified Sep 9, 2026 against antd@6.6.3. JSON

CommonJS CommonJS — require() works on every Node.js version

antd ships CommonJS only. require("antd") works everywhere. import "antd" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

It also declares a "module" field, so bundlers such as webpack, Vite and esbuild pick up an ESM build for tree-shaking.

Latest
6.6.3 (Sep 7, 2026)
Module format
CommonJS
Last CommonJS version
6.6.3
Native ESM since
6.4.0
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
3.2M
License
MIT

Does antd@6.6.3 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("antd") from a CommonJS file and import "antd" from an ES module.

Runtimerequire("antd")import "antd"
Node.js 18✓ works✓ works
Node.js 20✓ works✓ works
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4✓ works✓ works

How to import antd

ES modules (import)

import antd from "antd";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

const antd = require("antd");

Module format by version

Derived from the type, main and exports fields of every stable release on npm (658 versions; the newest 60 shown).

VersionsFormatFirst published
6.4.1 – 6.6.3CommonJSMay 14, 2026
6.4.0Dual (CommonJS + ESM)May 14, 2026
5.25.0 – 6.3.7CommonJSMay 7, 2025

Frequently asked

Is antd ESM-only?

antd@6.6.3 is a CommonJS package. antd ships CommonJS only. require("antd") works everywhere. import "antd" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Can I import antd with ES module syntax?

Yes. import antd from "antd" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

Does antd work in Bun?

Yes. import "antd" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does antd ship TypeScript types?

Yes. antd bundles its own type declarations; no @types package is needed.

Links

Other commonjs packages

Similar popularity