Replace moment with dayjs, support use in vite, rollup, webpack
npm i unplugin-moment-to-dayjs
Vite
// vite.config.ts
import momentToDayjs from 'unplugin-moment-to-dayjs/vite'
export default defineConfig({
plugins: [
momentToDayjs({ /* options */ }),
],
})
Example: playground/
Rollup
// rollup.config.js
import momentToDayjs from 'unplugin-moment-to-dayjs/rollup'
export default {
plugins: [
momentToDayjs({ /* options */ }),
],
}
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-moment-to-dayjs/webpack')({ /* options */ }),
],
}
Please reference antd-dayjs-webpack-plugin
- moment
- dayjs
- antd-dayjs-webpack-plugin