mathiasbynens / punycode.js

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891.
https://mths.be/punycode
MIT License
1.6k stars 159 forks source link

Using punycode.js as a named module does not work. #25

Open pennycoders opened 10 years ago

pennycoders commented 10 years ago

Hi,

Having previously configured the paths for require.js, whenever I am trying to use punycode as a named module, it does not seem to be available, until I use

require(['punycode'],function(punycode){
   console.log(punycode);
});

The example above works, compared to the one below, that does not

Otherwise, if I am doing something like

define(['./js/libs/punycode'], function(punycode){
  console.log(punycode);
}); 

then it does NOT work.

Cheers,

Alex.

mathiasbynens commented 10 years ago

CCing @jdalton

jdalton commented 10 years ago

As far as I can see punycode is doing nothing out of the ordinary in its module definition. Require.js supports specifying paths to named modules and packages.