Skip to content

Commit 683f67a

Browse files
committed
only remove __DEV__, not the number conversion
1 parent 67340b6 commit 683f67a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

config/processInvariants.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export async function processInvariants(options: BuildStepOptions) {
183183
if (
184184
node.callee.type === "MemberExpression" &&
185185
isIdWithName(node.callee.object, "invariant") &&
186-
isIdWithName(node.callee.property, "debug", "log", "warn")
186+
isIdWithName(node.callee.property, "debug", "log", "warn", "error")
187187
) {
188188
let newNode = node;
189189
if (node.arguments[0].type !== "Identifier") {
@@ -206,7 +206,10 @@ export async function processInvariants(options: BuildStepOptions) {
206206
});
207207
}
208208

209-
if (isDEVLogicalAnd(path.parent.node)) {
209+
if (
210+
isDEVLogicalAnd(path.parent.node) ||
211+
isIdWithName(node.callee.property, "error")
212+
) {
210213
return newNode;
211214
}
212215
fileRequiresDevImport = true;

0 commit comments

Comments
 (0)