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
Currently today all of your users (using webpack or other bundlers) are consuming 92kb of transmute. This is because the output target currently for your code (based on your babelrc) is CommonJS.
You can fix this by adding "modules": false for your preset: env options. Here is a link for the full documentation on the preset.
Attached above are examples of a webpack 4 build attempting to consume this library however pulling much more code then is actually needed. Since JavaScript is the most expensive resource to parse, its vital to only consume what you need. 😍
By doing this, webpack 2+ will be able to treeshake modules more effectively, and as of webpack +4, will be able to Scope Hoist and use our sideEffects: false feature to reduce the cost of using one export to roughly around 1-2kb instead of 92kb.
Currently today all of your users (using webpack or other bundlers) are consuming 92kb of
transmute
. This is because the output target currently for your code (based on your babelrc) is CommonJS.You can fix this by adding
"modules": false
for your preset: env options. Here is a link for the full documentation on the preset.Attached above are examples of a webpack 4 build attempting to consume this library however pulling much more code then is actually needed. Since JavaScript is the most expensive resource to parse, its vital to only consume what you need. 😍
By doing this, webpack 2+ will be able to treeshake modules more effectively, and as of webpack +4, will be able to Scope Hoist and use our
sideEffects: false
feature to reduce the cost of using one export to roughly around 1-2kb instead of 92kb.Here is a stack overflow response from me that explains the features and why: https://stackoverflow.com/questions/49160752/what-does-webpack-4-expect-from-a-package-with-sideeffects-false/49203452#49203452
@aem
The text was updated successfully, but these errors were encountered: