kenchris / urlpattern-polyfill

URLPattern polyfill
https://www.npmjs.com/package/urlpattern-polyfill
MIT License
268 stars 31 forks source link

Readme: fix imports #79

Closed fregante closed 2 years ago

fregante commented 2 years ago

The code is incorrect (import from is invalid) and browsers don't actually support the suggested line, you'd have to specify the whole import path including ./node_modules, but most people don't use it that way, so there's no need to specify that.

fregante commented 2 years ago

Maybe replaced by:

SanderElias commented 2 years ago

@fregante I think I handled this in #77, can you check if that works for you?

fregante commented 2 years ago

The new readme still uses import from

SanderElias commented 2 years ago

@fregante Can you be a bit more specific? I'm not sure I get what you are saying.

fregante commented 2 years ago

I don't know how more specific I can get: import from "name" is not valid syntax. You need to use import "name". Try running your examples and you'll see the error. See the changes in this PR to see the suggested code.