Skip to content

Commit

Permalink
fix: 🚑️ run all exit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Dec 8, 2022
1 parent 52026be commit fc8794c
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ function pxtorem(options?: PxtoremOptions) {
}
},
DeclarationExit(decl) {
if (checkoutDisable({ disable: opts.disable, isExcludeFile })) {
return
}

const { convertUnitOnEnd } = opts
if (convertUnitOnEnd) {
if (Array.isArray(convertUnitOnEnd)) {
Expand Down Expand Up @@ -160,23 +156,17 @@ function pxtorem(options?: PxtoremOptions) {
}
},
Comment(comment, { Warning }) {
// ignore disable
opts = {
...opts,
...getOptionsFromComment(comment, Warning),
}
},
CommentExit(comment) {
// ignore disable
if (comment.text.match(isPxtoremReg)?.length) {
comment.remove()
}
},
RootExit(r) {
if (checkoutDisable({ disable: opts.disable, isExcludeFile })) {
return
}

const root = r.root()

opts = initOptions(options)
Expand All @@ -186,7 +176,7 @@ function pxtorem(options?: PxtoremOptions) {
},
}

if (opts.disable) {
if (options?.disable) {
return {
postcssPlugin,
}
Expand Down

0 comments on commit fc8794c

Please sign in to comment.