Skip to content

Publish raw ES Modules without flow typings #11

@TheLarkInn

Description

@TheLarkInn

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.

screen shot 2018-07-27 at 3 07 17 pm

screen shot 2018-07-27 at 3 13 14 pm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions