A webpack plugin that replaces Moment.js with Day.js in Ant Design projects, reducing bundle size from ~65 KB gzipped to ~4 KB. Version 1.0.6 is stable with no recent updates. Key differentiator: single-step integration without manual code changes. Requires dayjs as a peer dependency and supports Ant Design 3.x via 'antdv3' preset, which introduces a mutable Day.js (BadMutable plugin). Commonly used to slim down antd-based React apps.
npm install antd-dayjs-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Shows minimal webpack config to replace Moment.js with Day.js in Ant Design projects, including locale setup.
Upgrade webpack to 4+ or use an older version of this plugin.
Set replaceMoment: true explicitly if needed, or rely on default.
Consider upgrading to antd 4+ to avoid using the antdv3 preset. If you must use antd 3, handle Day.js objects as mutable.
Manually alias moment to dayjs in webpack resolve.alias if needed, but be cautious of API differences.
Run npm install antd-dayjs-webpack-plugin --save-dev
Use const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');Use require() or ensure your webpack config supports ESM. The package exports a CommonJS module.