packages named 'something.js' #97

Closed
ryanramage opened this Issue Nov 22, 2012 · 5 comments

3 participants

@ryanramage
Collaborator

I am trying to publish sweet.js but it does not work correctly because this confuses require

define(['sweet.js'], function(sweet){ })

require seems to see the .js as meaning local so the package is never found.

@caolan
Owner

Yes, I've seen this problem before with RequireJS. Perhaps we should raise this as a RequireJS issue and see what their advice is?

@robmazan

Hi guys,

This is working by design:

There may be times when you do want to reference a script directly and not conform to the "baseUrl + paths" rules for finding it. If a module ID has one of the following characterstics, the ID will not be passed through the "baseUrl + paths" configuration, and just be treated like a regular URL that is relative to the document:

  • Ends in ".js".
  • Starts with a "/".
  • Contains an URL protocol, like "http:" or "https:".

http://www.requirejs.org/docs/api.html#jsfiles

@caolan
Owner
@ryanramage
Collaborator

I think rejecting packages with .js combined with #98 will be flexible enough.

@jonsharratt jonsharratt pushed a commit that referenced this issue Nov 27, 2012
Jon Sharratt Tweaks to the workings of @ryanramage for issue #97 to tidy up the se…
…ttings file a little. Additionally have added some unit tests to ensure valid package names get through.
7efeb73
@jonsharratt jonsharratt pushed a commit that referenced this issue Nov 27, 2012
Jon Sharratt Tweaks to the workings of @ryanramage for issue #97 to tidy up the se…
…ttings file a little. Additionally have added some unit tests to ensure valid package names get through.
ee9dc65
@jonsharratt jonsharratt pushed a commit to redbadger/jam that referenced this issue Nov 27, 2012
Jon Sharratt Work for issue #97
Tweaks to the workings of @ryanramage to tidy up the settings file a little. Additionally have added some unit tests to ensure validity of package names.
5a19891
@ryanramage
Collaborator

Closing. A PR happened #108.

@ryanramage ryanramage closed this Feb 6, 2013
@alexeykuzmin alexeykuzmin referenced this issue in requirejs/requirejs Apr 18, 2013
Closed

Allow '.js' suffix in packages names #716

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment