@ant-design/moment-webpack-plugin
Advanced tools
Comparing version 0.0.2 to 0.0.3
18
index.js
@@ -7,10 +7,16 @@ const generateRegExp = /generate\/dayjs/; | ||
class Plugin { | ||
constructor (options) { | ||
this.options = options || {}; | ||
} | ||
apply(compiler) { | ||
const { disableDayjsAlias } = this.options; | ||
const { alias } = compiler.options.resolve; | ||
if (alias) { | ||
alias.dayjs = 'moment'; | ||
} else { | ||
compiler.options.resolve.alias = { | ||
dayjs: 'moment', | ||
}; | ||
if (!disableDayjsAlias) { | ||
if (alias) { | ||
alias.dayjs = 'moment'; | ||
} else { | ||
compiler.options.resolve.alias = { | ||
dayjs: 'moment', | ||
}; | ||
} | ||
} | ||
@@ -17,0 +23,0 @@ compiler.hooks.normalModuleFactory.tap(plugin, (factory) => { |
{ | ||
"name": "@ant-design/moment-webpack-plugin", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3083
37