Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dunqing/unplugin-moment-to-dayjs
Replace moment with dayjs, support use in vite, rollup, webpack
https://github.com/dunqing/unplugin-moment-to-dayjs
antd antd-dayjs antd-dayjs-vite-plugin antd-dayjs-webpack-plugin dayjs esbuild moment momenttodayjs plugin rollup vite vite-plugin
Last synced: 6 days ago
JSON representation
Replace moment with dayjs, support use in vite, rollup, webpack
- Host: GitHub
- URL: https://github.com/dunqing/unplugin-moment-to-dayjs
- Owner: Dunqing
- License: mit
- Created: 2022-04-13T09:20:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-08T02:35:44.000Z (about 2 years ago)
- Last Synced: 2024-09-24T02:23:36.149Z (about 2 months ago)
- Topics: antd, antd-dayjs, antd-dayjs-vite-plugin, antd-dayjs-webpack-plugin, dayjs, esbuild, moment, momenttodayjs, plugin, rollup, vite, vite-plugin
- Language: TypeScript
- Homepage: https://unplugin-moment-to-dayjs.vercel.app
- Size: 660 KB
- Stars: 17
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unplugin-moment-to-dayjs
[![NPM version](https://img.shields.io/npm/v/unplugin-moment-to-dayjs?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-moment-to-dayjs)
**Replace moment with dayjs, support use in vite, rollup, webpack**
## Installation
```bash
npm i unplugin-moment-to-dayjs
```Vite
```ts
// vite.config.ts
import momentToDayjs from 'unplugin-moment-to-dayjs/vite'export default defineConfig({
plugins: [
momentToDayjs({ /* options */ }),
],
})
```Example: [`playground/`](./playground/)
Rollup
```ts
// rollup.config.js
import momentToDayjs from 'unplugin-moment-to-dayjs/rollup'export default {
plugins: [
momentToDayjs({ /* options */ }),
],
}
```
Webpack
```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-moment-to-dayjs/webpack')({ /* options */ }),
],
}
```
## Options
Please reference [antd-dayjs-webpack-plugin](https://github.com/ant-design/antd-dayjs-webpack-plugin)
## Examples
- [vite-ant-design-pro](https://github.com/Dunqing/vite-ant-design-pro/tree/main/playground)
## Thanks
- moment
- dayjs
- antd-dayjs-webpack-plugin