I think one of us is confused here. How are you importing from 'foo.js'? If you're importing from it, expecting that it's the body of a module, then you'll get a syntax error -- modules don't nest.
You could configure the loader so that it treats 'foo.js' as containing the definition of the 'foo' module plus other modules, in which case this works fine but there's no empty module at all. Sam On Wed, Jul 31, 2013 at 3:05 AM, Guy Bedford <[email protected]> wrote: > I'm in the process of matching up an ES6 module loader with AMD support to > the RequireJS tests, and have a question on concatenated module files. > > If I have a module, foo.js, which defines its own name and its dependencies: > > foo.js: > module 'foo' { > export var p = 'value'; > } > module 'foo/dependency' { > export var q = 'dep'; > } > > When loaded, will this ensure that the module value is defined from the > module statement taking precedence over the empty module implied by the lack > of exports? > > These techniques are used extensively for builds in RequireJS, which I think > would be very useful in ES6 modules and for the AMD polyfill path. > > Clarification would be appreciated to know if I'm correct in including this. > > Guy > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

