Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Fix of the issue that the module which ends with ! cannot be loaded #8 #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hashikuchi
Copy link

No description provided.

Add the new test cases of the module name including an exclamation mark.
Filter out the empty strings from the chunks so that the module whose name ends with '!' is properly recognized.
@hashikuchi
Copy link
Author

The fix of the issue #8

@lddubeau
Copy link

It is not advisable to use the exclamation point in file names meant to be loaded through an AMD loader. For better or for worse, the exclamation point indicates that the name before the exclamation point is a loader to be applied to the path appearing after the point. So text!foo.txt means "load foo.txt through the loader text".

You may think that a dependency with an empty path is meaningless, but that's not the case. The domReady plugin is a case in point. You can load it as domReady, in which case it is a plain module providing a function that you must then use to detect whether the DOM is ready or not. Or you can load it as domReady!, in which case it is a loader which waits for the DOM to be ready before resolving.

Since dependencies that specify a loader without a path are meaningful, it is not safe to assume that foo! is a literal module name with an exclamation point in it.

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

Successfully merging this pull request may close these issues.

2 participants