Skip to content

Document how to load a polyfill in Browserify #39

Open
@slorber

Description

@slorber

Hi,

I have not found any good reference explaining how to load a polyfill into a Browserify app.

I think polyfills must be loaded before other libs as some libs require the polyfill to be present when initialized to work correctly.

This is the case for exemple for FormatJS.io which may require Intl polyfill.

I think the way to go is to use bundle.add("polyfill") as we want to load the polyfill without having to require it, but in case multiple bundle.add are present, can we assume that the entry points will be loaded in order so that we are sure the polyfills are all loaded even before our app entry point is loaded?

This would be nice to document it, as many people may want to load polyfills into browserify apps.

I've explained how I solved my problem on SO: http://stackoverflow.com/questions/27870974/what-is-the-correct-way-to-load-polyfills-and-shims-with-browserify/28964831
But would also like to know if it's a good way to deal with polyfills.

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