-
Notifications
You must be signed in to change notification settings - Fork 11
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
Can this please (optionally) ignore UMD wrapped modules #288
Comments
Hi @gillyspy, thanks for opening the issue. Couple of clarifying questions:
|
Additionally, the |
hey, thanks for the quick reply. wow. 🙏🏻 the deploy target system uses depending on what i'm testing I'm using in the above UMD-stle module pattern I can load with either. Many modules, including the native modules, legacy modules are written in AMD style. in short... we test with require using modules that are expected to be transformed regardless of what they are. The challenge here is in testing in Node (using Jest incidentally). The other package is what is calling your transform. It is not using So, If your transform was able to ignore modules (like my pattern above) then I wouldn't have to jump through so many hoops to test scenarios where AMD-only modules are mixed with UMD modules (let alone mixed with CommonJS modules, but that should actually work too of course cuz that's what UMD is doing) i'll try that option but i'm not optimistic.. my hypothesis is that there is only a top level here -- it's just not one this babel plugin recognizes. also, not sure where yet to try it cuz it's kind of of buried in that oracle package (link above) |
Okay I'm having trouble wrapping my head around the use case exactly, and it complicates things that you don't have the ability to configure the transform directly, but regardless I think the request to have a way to exclude modules (e.g. via a comment at the top of the file), is a reasonable one. I should be able to pick this up this weekend, but if you would like to pick it up yourself I would happily review a pull request. Please let me know if you decide to do so so we don't duplicate work. |
@gillyspy #303 has been merged which gives an escape hatch to let you ignore modules by adding It might make sense to do more testing with UMD modules at some point and add additional handling to ignore them specifically -- if anyone else has more examples of modules that need ignoring, please post on this thread and I'll reopen this issue. |
It would be great if there was a way to tell the transform to ignore UMD wrapped modules.
We deploy to an environment that uses AMD but historically our testing has been using
requirejs
in node. We're switching to this because it's embedded in another package that will make our lives easier overall, buuuuut when werequire
modules written as below it failsit would be great if no matter which type of module we are passing it would survive.
The pattern we have is something like this (grabbed this from one of my templates):
I'd be happy with a comment declaration if i had to as a quick starter.
The text was updated successfully, but these errors were encountered: