Skip to content

Do not bundle babel-polyfill with library. Let it be an external peer dependency #109

Open
@anandanand84

Description

@anandanand84

Shipping babel polyfill with the library doesnt play nice with other libraries.

https://github.com/transcranial/keras-js/blob/master/src/index.js#L1

If an application depends on multiple libraries and everything ships with babel-polyfill it will cause

Uncaught Error: only one instance of @babel/polyfill is allowed

Even in cases where the other application doesnt ship with babel polyfill but depend on babel-polyfill, it will fail since the the babel polyfill will be loaded later when this(keras-js) dependency is loaded.

Only solution is to load the babel polyfill first from a cdn or the end application add it as a dependency in their build process

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions