Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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