Proposal:
- Auto-define a module if dev includes a ".js" extension (inject a noop factory: function () {})
- Fail if the dev used a ".js" extension with modules (define()s found in file)
- Fail if the dev forgot the ".js" ext on a non-module file
Pros:
- Allows use of run.js as a non-module
- Allows simple inclusion of non-modules without the js! plugin
- The js! plugin and the shim config could still be used for non-modules with dependencies
Cons:
- Newb confusion? Will noobs start thinking they can specify ".js" at the end of the module id?
- Will this prolong support for non-modules?
- Will folks think it will behave like RequireJS? (it won't because curl will use the paths mappings)
nice side-benefit: moving from two-script curl/run setup to a single script setup does not require changing run.js:
from this:
to this:
You can't (currently) do the first example when run.js is a module. We could likely find another way to make this work, though.