canirequire › CommonJS › 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.
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.
| Runtime | require("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).
| Versions | Format | First published |
|---|---|---|
| 6.4.1 – 6.6.3 | CommonJS | May 14, 2026 |
| 6.4.0 | Dual (CommonJS + ESM) | May 14, 2026 |
| 5.25.0 – 6.3.7 | CommonJS | May 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
- debug 4.4.3CommonJS
- semver 7.8.5CommonJS
- ms 2.1.3CommonJS
- picomatch 4.0.7CommonJS
- ajv 8.20.0CommonJS
- source-map 0.8.0CommonJS
- react-is 19.2.8CommonJS
- readable-stream 4.7.0CommonJS
Similar popularity
- mobx 7.0.3Dual
- eslint-config-react-app 7.0.1CommonJS
- workbox-webpack-plugin 7.4.1CommonJS
- babel-preset-react-app 10.1.0CommonJS
- babel-plugin-syntax-jsx 6.18.0CommonJS
- readline-sync 1.4.10CommonJS
- eslint-plugin-node 11.1.0CommonJS
- tsconfig 7.0.0CommonJS