UNPKG

@ctiterm/antd-dayjs-webpack-plugin

Version:
19 lines (13 loc) 488 B
const { getOptions } = require('loader-utils') module.exports = function loader(source) { const options = this.getOptions() options.plugins.forEach((plugin) => { source += `var ${plugin} = require('dayjs/plugin/${plugin}');` }) options.plugins.forEach((plugin) => { source += `dayjs.extend(${plugin});` }) // special plugin source += `var antdPlugin = require('@ctiterm/antd-dayjs-webpack-plugin/src/antd-plugin');dayjs.extend(antdPlugin);` return source }