title: Building Durandal with Grunt (R.js + Text)
body: <p>I would like to use Grunt to build a Durandal project, because Weyland remains completely undocumented and isn't as standard as Grunt.</p>
  
  <p>To do this, the grunt task needs to pull in all the js and html files during optimization, but I am unable to get RequireJS to inline the html files via the text module.</p>
  
  <p>It looks like weyland copies the text files <a href="https://github.com/BlueSpire/Weyland/blob/master/lib/commands/build/index.js#L28-L31" rel="nofollow noreferrer">manually</a>, but I can't figure out what it's doing to get requirejs (or almond, in this case), to actually use them. I have seeen <a href="https://stackoverflow.com/questions/15866683/inlining-require-js-text-using-grunt">this question</a>, but it requires the text modules to be referenced in the <code>define</code> call, which isn't done in Durandal.</p>
  
  <p>My gruntfile for require uses this config</p>
  
  <pre><code>requirejs: {
              build: {
                  options: {                  
                      name: '../lib/require/almond-custom', //to deploy with require.js, use the build's name here instead
                      insertRequire: ['main'], //needed for almond, not require
                      baseUrl: 'src/client/app',
                      out: 'build/main-built.js',
                      mainConfigFile: 'src/client/app/main.js', //needed for almond, not require
                      wrap: true, //needed for almond, not require
                      paths: {
                          'text': '../lib/require/text',
                          'durandal':'../lib/durandal/js',
                          'plugins' : '../lib/durandal/js/plugins',
                          'transitions' : '../lib/durandal/js/transitions',
                          'knockout': '../lib/knockout-2.3.0',
                          'bootstrap': '../lib/bootstrap.min',
                          'jquery': '../lib/jquery-1.9.1',
                          'Q' : '../lib/q.min'
                      },
                      inlineText: true,
                      optimize: 'none',
                      stubModules: ['text']               
                  }
              }
          }
  </code></pre>