0.0.2 • Published 6 years ago
dayjs-webpack-plugin
Licence
MIT
Version
0.0.2
Deps
1
Size
4 kB
Vulns
0
Weekly
0
dayjs-webpack-plugin
A webpack plugin for dayjs.
- Pre-pack all the needed plugins and locales.
- Auto replace
momentwithdayjsin source code.
Usage
- Install
dayjs-webpack-plugin. - Add an instance of the plugin to the webpack plugin configuration.
Example
import DayjsWebpackPlugin from 'dayjs-webpack-plugin';
const configuration = {
plugins: ['utc'],
locales: ['zh-cn'],
replaceMoment: true
};
module.exports = {
// ...
plugins: [
new DayjsWebpackPlugin(configuration)
]
};
Configuration
| Attribute | Description | Type | Accepted Values | Default |
|---|---|---|---|---|
| plugins | plugin name | Array[string] | all support plugins | [] |
| locales | locale name | Array[string] | all support locales | [] |
| replaceMoment | replace moment to dayjs with webpack alias config | Boolean | true / false | false |
| preset | name of preset configuration | String | antd | - |