-
Notifications
You must be signed in to change notification settings - Fork 12.8k
do not treat modules with '!' in names any specially #5759
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
Conversation
👍 |
1 similar comment
👍 |
Just to confirm, this was originally in here to support |
do not treat modules with '!' in names any specially
@weswigham i really do not know why this was there :) the issue is that SystemJs and requireJS have a different way to represent loaders. so what we have done in the past, is we do nothing :) we just treat it like a module name, obviously a file lookup will fail, but then we will look for an ambient external module with that name, and if you defined one, things should just work. |
and it has fixed the issue... Technically, it isn't RequireJS, it is the whole of AMD ;-) I can understand why it might have seemed like a good idea, but the only approach I can envision is that the module resolution logic narrows to the bang instead of widening to the bang and/or if the module contains a bang, it looks at the ambient module space first before attempt to resolve to the file. What was happening is that any MID like If I had a mid of declare module 'text' {
export default let text: string;
} I might benefit from validating that I can actually resolve For AMD it is reversed though, while we have just gotten used to declaring ambient modules for each different plugin, it would be nice to actually declare something like this: declare module 'dojo/text' {
export default let text: string;
} And then have anything like 'dojo/text!some/file.txt' work, but the problem specifically I was running into though was that would have worked before this fix, but then when I had a module that returned different things based on the information past the bang, it would never find the ambient declaration. If I really had my dreams filled, there would be some sort of globbing support for mids and ambient modules. Maybe I should open an issue for that. |
@kitsonk thanks for the details. question, would it possible that |
The shape can vary. I opened #5787 to put forward a suggestion around this. |
fixes #5729