You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is low priority, but I thought I'd mention it. Currently, the helper functions are imported directly from lodash, i.e.
import{debounce,throttle}from'lodash-es';
This resolves to lodash's index file, which bundles all available functions.
Now, when using a bundle with support for tree shaking, all functions that are not needed will get dropped and won't be included in the final bundle. That works as expected.
But there's another use case: For development, we are using the native browser ESM support and include the JavaScript files as module scripts directly, without a build step. The browser won't do any tree shaking, so it will import all sub modules from lodash, which can take a bit of time.
This could be solved by importing only from the lodash modules that are actually required, e.g. change
This is low priority, but I thought I'd mention it. Currently, the helper functions are imported directly from
lodash
, i.e.This resolves to lodash's index file, which bundles all available functions.
Now, when using a bundle with support for tree shaking, all functions that are not needed will get dropped and won't be included in the final bundle. That works as expected.
But there's another use case: For development, we are using the native browser ESM support and include the JavaScript files as module scripts directly, without a build step. The browser won't do any tree shaking, so it will import all sub modules from lodash, which can take a bit of time.
This could be solved by importing only from the lodash modules that are actually required, e.g. change
to
in https://github.com/Grsmto/simplebar/blob/9e0505ccf3a0e036ca545ea9d9ef0ea84e149ef0/packages/simplebar-core/src/index.ts#L2C1-L3C1
The text was updated successfully, but these errors were encountered: