mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-01-09 15:47:55 -05:00
Fix config generation when minifying (#2657)
Co-authored-by: rejas <github@veeck.de>
This commit is contained in:
committed by
GitHub
parent
efde16bdbc
commit
313a7ade28
@@ -99,7 +99,11 @@ function build(generate, generateBanner, pkg) {
|
||||
}
|
||||
['enableClasses', 'enableJSClass', 'usePrefixes'].forEach(function(configName) {
|
||||
if (config && typeof config[configName] === 'boolean') {
|
||||
output = output.replace(new RegExp('(' + configName + '\\\'?\\s?:\\s?)(true|false)([,\\n])'), '$1' + Boolean(config[configName]) + '$3');
|
||||
if (config.minify) {
|
||||
output = output.replace(new RegExp('(' + configName + '\\\'?\\s?:\\s?)(!?0)([,\\n])'), '$1' + (config[configName] ? "!0" : "!1") + '$3');
|
||||
} else {
|
||||
output = output.replace(new RegExp('(' + configName + '\\\'?\\s?:\\s?)(true|false)([,\\n])'), '$1' + Boolean(config[configName]) + '$3');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user