Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct way to polyfill? #12

Closed
kainsavage opened this issue Aug 5, 2022 · 5 comments
Closed

Correct way to polyfill? #12

kainsavage opened this issue Aug 5, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kainsavage
Copy link

Howdy, I could not figure out the right way to use this polyfill in an npm project (simple create-react-app for example).

Eventually, I copied the contents node_modules/context-filter-polyfill/dist/index.js into a <script> tag in my head, and this worked but feels like the wrong way to do it.

What's the correct way?

@TheBlindHawk
Copy link

Hey just sharing my method:

npm i context-filter-polyfill

then add

import 'context-filter-polyfill/dist/index.js';

in your js file (or use require instead of import)
I think these two steps would be a nice thing to add to the README file : )

@davidenke
Copy link
Owner

I think these two steps would be a nice thing to add to the README file : )

@TheBlindHawk you're right, would you mind to contribute a pr?

@davidenke davidenke added help wanted Extra attention is needed enhancement New feature or request labels Feb 15, 2023
@donni106
Copy link

import 'context-filter-polyfill/dist/index.js';

this should be the same as import 'context-filter-polyfill'

@TheBlindHawk
Copy link

@davidenke
Sorry for not replying, turns out I had notifications off on github and the email didn't reach me.
Thanks for the offer anyways! : )

@davidenke
Copy link
Owner

@TheBlindHawk me too, that's why it took years for me to notice :P

I already updated the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants