Skip to content

Commit ab4080c

Browse files
committed
Fix incorrect name for expression defines
1 parent c524e9c commit ab4080c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ const toReplacementExpression = (value, name) => {
3333
return [JSON.stringify(matches[2]), name];
3434
}
3535

36-
// --define A=1,B=true produces int/boolean literal, and
3736
// --define @assign=Object.assign replaces expressions with expressions:
38-
if (/^(true|false|\d+)$/i.test(value) || name[0] === '@') {
37+
if (name[0] === '@') {
38+
return [value, name.substring(1)];
39+
}
40+
41+
// --define A=1,B=true produces int/boolean literal:
42+
if (/^(true|false|\d+)$/i.test(value)) {
3943
return [value, name];
4044
}
4145

0 commit comments

Comments
 (0)