Vite plugin that replaces Moment.js with Day.js in Ant Design (antd) to reduce bundle size. Current stable version is 2.0.0, requires dayjs >=1 and vite >=5. It is the Vite counterpart of antd-dayjs-webpack-plugin, offering the same configuration options. Key differentiator: directly swaps moment locales and plugins with dayjs equivalents at build time, no manual code changes needed.
npm install antd-dayjs-vite-pluginVerified import paths — ran on the pinned version, not inferred.
Minimal usage: add the plugin to vite config to replace moment with dayjs in antd.
Change import from `import antdDayjs from '...'` to `import { antdDayjs } from '...'`.Upgrade Vite to version 5 or later, or use v1.x with Vite 4.
Manually replace `moment` imports with `dayjs` in your own code if needed.
Ensure dayjs locale and plugin (e.g., utc, advancedFormat) are explicitly imported if used by antd components.
Use named import: `import { antdDayjs } from 'antd-dayjs-vite-plugin'`.Run `npm install antd-dayjs-vite-plugin` or check package.json.
Use `import { antdDayjs } from 'antd-dayjs-vite-plugin'`.