yeoman/yeoman — pull request #711 by mazerte (2012-11-12 15:09:43+00:00)
Title: RequireJS and Module

I work on a new generator for yeoman: footguard (https://github.com/mazerte/yeoman-footguard)
I have a problem with "whole project optimizing" (http://requirejs.org/docs/optimization.html#wholeproject) in RequireJS. When I specify the "dir" directive in require.config the build task doesn't work.

````javascript
grunt.initConfig({

rjs: {
// no minification, is done by the min task
baseUrl: 'js/',
appDir: '../app/',
dir: './',

wrap: true,

removeCombined: true,
keepBuildDir: true,

inlineText: false,
mainConfigFile: 'js/main.js',

optimize: "none",

modules: [
{
name: 'app/vendors',
exclude: []
},
{
name: 'app/app',
exclude: ['app/vendors']
},
{
name: 'main',
exclude: [
'config',
'app/app',
'app/vendors',
'../components/chai/chai',
'../components/expect/expect',
'../components/mocha/mocha'
]
}
]
}
});
```

With this config I have two problems:
* the first one is in "rjs" task when "min_max_info" helper is called, the "baseUrl" change after optimizing and the original value is stored in "originalBaseUrl"
* the second one is in "usemin" task when the script look for "data-main" attribute. This task override rjs.out config, it doesn't work with "rjs.dir" config

You can test my configuration with footguard:
```bash
$ mkdir project
$ cd project
$ npm init
$ npm install https://github.com/mazerte/yeoman-footguard.git
$ yeoman init footguard
$ yeoman build
```