Re: include 'foo/index.js' or include 'foo'?

2015-02-06 Thread Isiah Meadows
. From: John Barton johnjbar...@google.com To: Glen Huang curvedm...@gmail.com Cc: monolithed monolit...@gmail.com, es-discuss es-discuss@mozilla.org Date: Thu, 5 Feb 2015 07:53:47 -0800 Subject: Re: include 'foo/index.js' or include 'foo'? The following solution has worked very well for us

Re: include 'foo/index.js' or include 'foo'?

2015-02-06 Thread Isiah Meadows
. From: John Barton johnjbar...@google.com To: Glen Huang curvedm...@gmail.com Cc: monolithed monolit...@gmail.com, es-discuss es-discuss@mozilla.org Date: Thu, 5 Feb 2015 07:53:47 -0800 Subject: Re: include 'foo/index.js' or include 'foo'? The following solution has worked very

include 'foo/index.js' or include 'foo'?

2015-02-05 Thread monolithed
I could not find an answer in the specification regarding the following cases: import './foo/index.js' import 'foo/index.js' import 'foo/index' import 'foo' import 'foo/' Is there a difference? Node.js lets create an 'index.js' file, which indicates the main include file for a directory. So if

Re: Re: include 'foo/index.js' or include 'foo'?

2015-02-05 Thread monolithed
```js import './foo/index.js'; import 'foo/index.js'; import 'foo/index'; import 'foo'; import 'foo/‘; ``` ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: include 'foo/index.js' or include 'foo'?

2015-02-05 Thread Glen Huang
I believe this is out the scope of ecmascript. It’s up to the host to determine how the paths are resolved. See https://people.mozilla.org/~jorendorff/es6-draft.html#sec-hostnormalizemodulename https://people.mozilla.org/~jorendorff/es6-draft.html#sec-hostnormalizemodulename On Feb 5, 2015,

Re: include 'foo/index.js' or include 'foo'?

2015-02-05 Thread John Barton
The following solution has worked very well for us: import './foo/index.js'; means resolve './foo/index.js' relative to the importing file. All of the rest mean look up 'foo' in the developer's mapping of names, replacing 'foo' with a path that is then used to resolve the import. To be sure