@ant-design/moment-webpack-plugin
Advanced tools
Comparing version 0.0.4 to 1.0.0
@@ -1,14 +0,11 @@ | ||
import type { Plugin } from "webpack"; | ||
import type { Plugin, Compiler } from "webpack"; | ||
declare namespace AntdMomentWebpackPlugin { | ||
interface Options { | ||
disableDayjsAlias?: boolean; | ||
} | ||
} | ||
declare class AntdMomentWebpackPlugin extends Plugin { | ||
constructor( | ||
options?: AntdMomentWebpackPlugin.Options | ||
); | ||
constructor(); | ||
apply(compiler: Compiler): void; | ||
} | ||
export = AntdMomentWebpackPlugin; |
15
index.js
@@ -7,17 +7,6 @@ const generateRegExp = /generate\/dayjs/; | ||
class Plugin { | ||
constructor (options) { | ||
constructor(options) { | ||
this.options = options || {}; | ||
} | ||
apply(compiler) { | ||
const { disableDayjsAlias } = this.options; | ||
const { alias } = compiler.options.resolve; | ||
if (!disableDayjsAlias) { | ||
if (alias) { | ||
alias.dayjs = 'moment'; | ||
} else { | ||
compiler.options.resolve.alias = { | ||
dayjs: 'moment', | ||
}; | ||
} | ||
} | ||
apply (compiler) { | ||
compiler.hooks.normalModuleFactory.tap(plugin, (factory) => { | ||
@@ -24,0 +13,0 @@ factory.hooks.beforeResolve.tap(plugin, (result) => { |
{ | ||
"name": "@ant-design/moment-webpack-plugin", | ||
"version": "0.0.4", | ||
"version": "1.0.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
0
3128
34