Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Browserify / Conditional Loading #185

Closed
SamAmiri opened this issue Jun 15, 2016 · 2 comments
Closed

Browserify / Conditional Loading #185

SamAmiri opened this issue Jun 15, 2016 · 2 comments

Comments

@SamAmiri
Copy link

Hi Andy,

Thanks for the great polyfill, I am trying to conditionally load the polyfill in for Safari, but with the implementation that you provided Browserify does not support require.ensure that is only with Webpack.

How should this be loaded?

@caridy
Copy link
Collaborator

caridy commented Jun 15, 2016

@SamAmiri I'm not sure what else can you do with Browserify. But If you find out, let us know.

I normally suggest to avoid declaring an explicit dependency between a module and a polyfill, especially if you're using a bundler like browserify, and instead do your own thing to provision your runtime before evaluating your modules, or use the polyfill service from FT, which does that for you for free :)

@SamAmiri
Copy link
Author

SamAmiri commented Jun 15, 2016

@caridy

Thanks for the prompt response, I am thinking of implementing browserify-require-async to see if that will work. Would you mind to update the current README to reflect Browserify does not use require.ensure?

@SamAmiri SamAmiri reopened this Jun 15, 2016
@caridy caridy closed this as completed in 5fe77ee Jun 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants