-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Use the lib-font browser bundle in a webpack project. #135
Comments
I'm a little confused why you would add the browser library to your bundle when it's already a standard JS library that you can load with a |
I think the idea here is to avoid polluting the global |
Then don't use I'll add a section to the README on how to do this, although at this point I'm not sure it makes sense to even still use webpack, it's kind of a terrible bundler that we all used because as bad as it was, it was better than browserify. Ever since (Having said that: other people using undocumented globals is their problem, not yours. If someone doesn't stick to your API docs, that's on them) |
Hi 👋 I'm trying to use the browser bundle in a large project where the dependencies are managed using NPM and the project is built using webpack. I have a few questions about that:
It seems like I can not import
lib-font.browser.js
using the npm installed package. Can I?If I
import { Font } from "lib-font"
I get errors aboutfs
andzlib
missing dependencies. I could avoid that failure by adding the following config to the webapck config file. But due to characteristics of this project I can't modify the webpack config file.Apart I tried copying the entire
lib-font.browser.js
file into my project's source code I get errors when building the app with webapck:If I delete the references to fs and zlib from
lib-font.browser.js
it works as expected but I would like to avoid forking the package. So I return to my original question: Is there any way to include the lib-font browser bundle in a npm + webpack project without errors about missing dependencies?Thanks for the great work!
The text was updated successfully, but these errors were encountered: