Friday, January 27, 2012

RequireJS 1.0.5 released

RequireJS 1.0.5 is available.
The notable changes:
  • Small fix for running the optimizer on Windows with Node 0.6.8.
  • Fix bug with loading Dojo code from source.
  • New config option that allows using the RequireJS config from your main JS file as part of the optimizer options.  It is mentioned in a new "common pitfalls" section in the optimizer doc.
Complete set of changes:


geddesign said...

the #pitfalls link takes me to the optimizer section... I don't see where to use the main.js build settings in

James Burke said...

geddesign: sounds like a cache issue. Clear cache or shift reload to get latest version.

geddesign said...

yep! There she is. Chrome caches like a beast. Hey nice job on the shared config, that's really awesome, and useful for my wrap plugin. Question: So is it possible to override just the parts that need to be different in the build? For example if all my paths are in main.js, but then for the build I want jQuery's path to be different, could I do this:

paths.jquery = "...";

Or would I have to redefine the entire paths object? I realize then my config starts to look more like JS and less like JSON, just want to make sure you that's a recommended approach...

James Burke said...

geddesign: Yes the order or precedence: command line options > build file options > mainConfigFile options.

So anything in the build file options will override the mainConfigFile options, and for items like paths that are an object, their properties are merged, but only a first level merge -- for a given config object, it does not do an arbitrarily nested merge, just a first level property merge.