canirequire › CommonJS › ant-design-vue
Is ant-design-vue ESM-only? Can you require() it?
An enterprise-class UI design language and Vue-based implementation
Latest version 4.2.6, published Nov 11, 2024. JSON
CommonJS CommonJS — require() works on every Node.js version
ant-design-vue ships CommonJS only. require("ant-design-vue") works everywhere. import "ant-design-vue" 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 ant-design-vue@4.2.6 actually load? Runtime test results
Runtime probe pending for this version. The values below are what package.json declares; they are refreshed once the probe runs.
| Runtime | require("ant-design-vue") | import "ant-design-vue" |
|---|---|---|
| Node.js 18 | ✓ expected | ✓ expected |
| Node.js 20 | ✓ expected | ✓ expected |
| Node.js 22 | ✓ expected | ✓ expected |
| Node.js 24 | ✓ expected | ✓ expected |
| Node.js 26 | ✓ expected | ✓ expected |
| Bun 1.4 | pending | pending |
Install failed in our sandbox: PROBE_TIMEOUT The rows above show what package.json declares.
How to import ant-design-vue
ES modules (import)
import antDesignVue from "ant-design-vue";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 antDesignVue = require("ant-design-vue");Module format by version
Derived from the type, main and exports fields of every stable release on npm (131 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 2.0.0 – 4.2.6 | CommonJS | Feb 6, 2021 |
Frequently asked
Is ant-design-vue ESM-only?
ant-design-vue@4.2.6 is a CommonJS package. ant-design-vue ships CommonJS only. require("ant-design-vue") works everywhere. import "ant-design-vue" 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 ant-design-vue with ES module syntax?
Yes. import antDesignVue from "ant-design-vue" 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 ant-design-vue ship TypeScript types?
Yes. ant-design-vue 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
- broccoli-asset-rev 3.0.0CommonJS
- ember-cli-inject-live-reload 2.1.0CommonJS
- babel 6.23.0CommonJS
- @vue/cli-plugin-typescript 5.0.9CommonJS
- jsdoc-to-markdown 9.1.3Dual
- react-addons-test-utils 15.6.2CommonJS
- gulp-less 5.0.0CommonJS
- istanbul-instrumenter-loader 3.0.1CommonJS