Refactor to use ES Modules + Rollup (CJS, ESM, UMD) + Babel + ESLint/Prettier#118
Refactor to use ES Modules + Rollup (CJS, ESM, UMD) + Babel + ESLint/Prettier#118dmnsgn wants to merge 23 commits intobramstein:masterfrom
Conversation
…Prettier and ditch Grunt/Closure Compiler
|
Nice freaking work, dude! Saving my life right now, since my project compiles with webpack and rollup. Of course it was freaking out about the commonjs export. |
|
It would be wonderful if this was published as es modules. |
* 'master' of https://github.com/bramstein/fontfaceobserver: 2.1.0 Add dist files. Fix calling phantomjs. Upgrade Grunt and Mocha. Reject promises with Error objects Adds an example of dynamically creating observers, closes bramstein#121 # Conflicts: # Gruntfile.js # fontfaceobserver.js # fontfaceobserver.standalone.js # package-lock.json # package.json # src/observer.js # test/observer-test.js
|
Updated with latest commits and fixes: https://unpkg.com/fontfaceobserver-es@3.3.1/dist/fontfaceobserver.esm.js Fixed all the tests Available to test from at: |
|
thanks! |
|
Can I help anyway to make this PR merged? I think this is very important, Currently many projects use webpack or rollup, and having this library not being tree shakable is a big down for those. In our case, we detected that our bundle size incremented > 40% due to just use this library, and we are investigating to move away from it for this very reason. |
|
Thanks for the package |
|
Love to see this merged, please? |
This change adds `fontobserver-es` npm module monitor when a webfont is loaded and notify. Please note that it is different from `fontfaceobserver` module, we choose `fontobserver-es` because it's an es module. ref: - bramstein/fontfaceobserver#118 - https://github.com/dmnsgn/fontfaceobserver
This change adds `fontobserver-es` npm module monitor when a webfont is loaded and notify. Please note that it is different from `fontfaceobserver` module, we choose `fontobserver-es` because it's an es module. ref: - bramstein/fontfaceobserver#118 - https://github.com/dmnsgn/fontfaceobserver
|
I can also confirm fontfaceobserver-es works when using the following import: |
This is a big one: it includes a lot of changes and some stylistic ones so I'd understand if you don't like some of them and you might also not have the time to review it but I figured I tried. Also I have seen you were interested in switching to ES modules (#102) so here it is:
All tests are the same and passing in Node 4 to 8: https://travis-ci.org/dmnsgn/fontfaceobserver
You can see the output bundles keep a small size gzipped:
I published it on npm to have a play: https://www.npmjs.com/package/fontfaceobserver-es
Thanks