dayjs-webpack-plugin

0.0.2 • Public • Published

dayjs-webpack-plugin

NPM version

A webpack plugin for dayjs.

  • Pre-pack all the needed plugins and locales.
  • Auto replace moment with dayjs in source code.

Usage

  1. Install dayjs-webpack-plugin.
  2. 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 -

Readme

Keywords

Package Sidebar

Install

npm i dayjs-webpack-plugin

Weekly Downloads

396

Version

0.0.2

License

MIT

Unpacked Size

3.64 kB

Total Files

3

Last publish

Collaborators

  • iamkun