mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Remove freeExports var when not used via exports build option.
Former-commit-id: 66950af3a18b35412fbe1092e19c5d7ef0c9a029
This commit is contained in:
4
build.js
4
build.js
@@ -1183,6 +1183,10 @@
|
||||
// remove `if (freeExports) {...}` if it's empty
|
||||
source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}(?:\s*else *{\n([\s\S]+?) *})?/, '$1');
|
||||
|
||||
if ((source.match(/\bfreeExports\b/g) || []).length < 2) {
|
||||
source = removeVar(source, 'freeExports');
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
// customize Lo-Dash's IIFE
|
||||
|
||||
Reference in New Issue
Block a user