I mean for example:
lodash include=each,find,filter,map,some,debounce,defer,delay,throttle,uniq,assign,extend,merge,omit,without,findIndex,compact,replace,groupBy,max,uniqueId
When I try to import in es modules, I get a warning like this:
Bundled and transpiled successfully, but with warnings: The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
Is there any option to have the same custom (reduced) build, but suitable to be imported in modules and then available through '_' as always?
Thank you
You could create your own aggregating module in a local file...such as tools/lodash.js:
export {
each, find, filter, map, some, debounce, defer, delay, throttle,
uniq, assign, extend, merge, omit, without, findIndex, compact,
replace, groupBy, max, uniqueId
} from 'lodash';
Then when you wanted these tools you could add
import * as _ from './tools/lodash`;
If you don't like the import * as _ syntax, you could do a straight import in your aggregating module and then do an export default { each, find, ... };. That would allow you to do import _ from './tools/lodash';.