-
Notifications
You must be signed in to change notification settings - Fork 55
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
Running through rollup for node causes issues with dynamic require #6
Comments
True. I think we can replace it with dynamic import |
Short of directly publishing ESM, one pattern I've used to solve this issue before is to use a I've created a Rollup issue for this here - rollup/plugins#341. |
@rowanwins are you bundling for web via rollup, or for Node? For web none of that code should be processed. It just requires using the node-resolve plugin with the default |
I was trying to two seperate bundles so I could support both. My browser bundle is working fine, but my node bundle is where I run into the issue. |
Just looping back here - it doesn't seem like the @guybedford - I wonder, is there a way to exempt a require() statement from processing by rollup's commonjs plugin? Maybe just switching it to |
@developit perhaps try |
I was recently bundling with webpack, and also ran into this issue. The solve was to use |
I just ran into this issue as well. My error looked like this:
Your solution to label set it to |
Maybe not, I thought it fixed it but now the code builds but doesn't resolve modules correctly in the browser :( Addendum: In the end I rolled back the "openlayers" library to a version that doesn't use the "web-workers" library at all. That's my solution for now. |
I still have to lock openlayers to an old version to work around this. |
Okay, I fixed it by adding this to my rollup config plugins section:
|
Thanks for a neat little library!
I was attempting at incorporating it into a library of mine which I bundle using rollup and I get an issue
which was related to this line of your library
From what I can tell it looks like it's to do with requiring the URL of the worker?
Anyway just thought I'd flag it as other users of rollup may run into the same issue.
Cheers
Rowan
The text was updated successfully, but these errors were encountered: