unplugin-moment-to-dayjs
v0.5.0
Published
Register global imports on demand for Vite and Webpack
Downloads
168
Maintainers
Readme
unplugin-moment-to-dayjs
Replace moment with dayjs, support use in vite, rollup, webpack
Install
npm i unplugin-moment-to-dayjs
// vite.config.ts
import momentToDayjs from 'unplugin-moment-to-dayjs/vite'
export default defineConfig({
plugins: [
momentToDayjs({ /* options */ }),
],
})
Example: playground/
// rollup.config.js
import momentToDayjs from 'unplugin-moment-to-dayjs/rollup'
export default {
plugins: [
momentToDayjs({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-moment-to-dayjs/webpack')({ /* options */ }),
],
}
Options
Please reference antd-dayjs-webpack-plugin
Examples
Thanks
- moment
- dayjs
- antd-dayjs-webpack-plugin