Skip to content
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

Bundle size pretty big, since universal-url #126

Closed
243083df opened this issue Jun 15, 2021 · 6 comments
Closed

Bundle size pretty big, since universal-url #126

243083df opened this issue Jun 15, 2021 · 6 comments
Labels

Comments

@243083df
Copy link

Seems like url-polyfill must be used instead.

@janhommes
Copy link
Owner

mh, can you point me which file you mean? The polyfill itself?

the main file is quite alright, or not? https://unpkg.com/browse/[email protected]/dist/umd/

@243083df
Copy link
Author

File size is ok, but probles is that this is not all code, since it contains require("universal-url") and another requires.
And when webpack try to build bundle, it connect every require with package including universal-url with tr46

@janhommes
Copy link
Owner

I see. Didn't think of webpack.

I guess I need to place everything inside o.polyfill.ts.

@janhommes janhommes added the bug label Jun 16, 2021
@janhommes
Copy link
Owner

The require calls are there to make it work in node.js if fetch or URL is not present. As said, did not think about webpack.

Just checked out this:
https://stackoverflow.com/questions/34828722/how-can-i-make-webpack-skip-a-require

Maybe it is worth a try to use window.require?

@janhommes
Copy link
Owner

could you try this one if the require() calls are still picked up by webpack?
https://www.npmjs.com/package/o.js/v/1.4.0-rc0

@243083df
Copy link
Author

Still picked up :C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants