Closed gridsane closed 3 years ago
We found an issue in the .min build of @bem-react/classname package.
.min
@bem-react/classname
classname.development.js:
classname.development.js
cn('block')({ mod: '1' }) // block__mod_1
classname.production.min.js:
classname.production.min.js
cn('block')({ mod: '1' }) // block__mod
This happens because of booleans_as_integers terser option.
booleans_as_integers
This expression:
if (modVal === true) { className += modPrefix + k; } else { <...> }
Transforms to:
1 == p ? v += u + s : <...>
It's impossible to use mod values '1' or 1 with such transform.
'1'
1
Full diff with and without booleans_as_integers option: https://www.diffchecker.com/2XzvNEZg
@yarastqt could you please publish @bem-react/classname with this fix?
Available start from:
- @bem-react/classname@1.5.11 - @bem-react/classnames@1.3.10 - @bem-react/core@3.0.7 - @bem-react/di@2.2.7
We found an issue in the
.min
build of@bem-react/classname
package.classname.development.js
:classname.production.min.js
:This happens because of
booleans_as_integers
terser option.This expression:
Transforms to:
It's impossible to use mod values
'1'
or1
with such transform.Full diff with and without
booleans_as_integers
option: https://www.diffchecker.com/2XzvNEZg