-
Notifications
You must be signed in to change notification settings - Fork 645
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
Add ES6 import instead of require() #393
Comments
This isn't really an issue. If you think the docs should include:
You should submit a pull request to add it. |
great! I didn't know the syntax for the import, so couldn't do a PR. Some libraries require How did you know which? |
It depends on what is exported. Take a look at this: http://2ality.com/2014/09/es6-modules-final.html |
The library does not support module import. When imported in a module using:
you get:
Indeed, looking at the package, there seems to be no support for ESM. It would be convenient to add such support now that module imports are supported in major browsers. |
Trying to use WebFont loader with Polymer. The only import that worked for me was import * as WebFont from 'webfontloader' and the use window.WebFont.load(...); Which means the imported Would be nice if ES6 import could work the way it supposed to: import WebFont from 'webfontloader';
WebFont.load(...); |
In the case of NPM, currently the documentation says to:
var WebFont = require('webfontloader')
But i think it'd be great if you could add the ES6 method of importing the library as well!
The text was updated successfully, but these errors were encountered: