Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

packages named 'something.js' #97

Closed
ryanramage opened this Issue · 5 comments

3 participants

Ryan Ramage Caolan McMahon Robert Mazan
Ryan Ramage
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 McMahon
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?

Robert Mazan

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 McMahon
Owner
Ryan Ramage
Collaborator

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

Jon Sharratt jonsharratt referenced this issue from a commit
Jon Sharratt jonsharratt 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
Jon Sharratt jonsharratt referenced this issue from a commit
Jon Sharratt jonsharratt 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
Jon Sharratt jonsharratt referenced this issue from a commit in redbadger/jam
Jon Sharratt jonsharratt 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
Ryan Ramage
Collaborator

Closing. A PR happened #108.

Ryan Ramage ryanramage closed this
Alexey Kuzmin alexeykuzmin referenced this issue in jrburke/requirejs
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
Something went wrong with that request. Please try again.