thlorenz / browserify-shim

📩 Makes CommonJS incompatible files browserifyable.
MIT License
933 stars 87 forks source link

Having a hard time shimming FontFaceObserver #186

Closed silvenon closed 8 years ago

silvenon commented 9 years ago

I thought fontfaceobserver is an easy target, because it exports window.FontFaceObserver, so I tried the following:

"browserify-shim": {
  "fontfaceobserver": "FontFaceObserver"
}

Unfortunately it didn't work :( When I tried to instantiate FontFaceObserver, this was the error:

Uncaught TypeError: _fontfaceobserver2.default is not a function

Do you want a test case?

Btw, I :heart: browserify-shim, great work!

bendrucker commented 9 years ago

Test case would be helpful, but I'm not sure how much we can do here. The project ships with a pretty gross minified built file as the main.

silvenon commented 9 years ago

I thought it doesn't matter since it's clear what it exports. Yeah, it's minified with Closure Compiler, but it's not that unreadable when you beautify it.

I'm just really curious what's happening. I guess I should dig into what exactly browser-shim is doing.

bendrucker commented 9 years ago

Yeah if you investigate we'd be happy to take a PR if needed. This isn't something I can spend time on myself at the moment.

bendrucker commented 8 years ago

If you have more info and it's clear b-shim could be doing something differently we can reopen this one