Note that there are some explanatory texts on larger screens.

plurals
  1. POGrunt: including a generated file in usemin
    text
    copied!<p>This is the relevant part in my <code>index.html</code>:</p> <pre><code>&lt;!-- build:js scripts/scripts.js --&gt; &lt;script src="scripts/vendor/jquery.js"&gt;&lt;/script&gt; &lt;script src="scripts/vendor/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script src="scripts/vendor/handlebars.runtime.js"&gt;&lt;/script&gt; &lt;script src="scripts/vendor/ember.js"&gt;&lt;/script&gt; &lt;script src="scripts/vendor/ember-data.js"&gt;&lt;/script&gt; &lt;script src="scripts/templates.js"&gt;&lt;/script&gt; &lt;script src="scripts/neuterapp.js"&gt;&lt;/script&gt; &lt;!-- endbuild --&gt; </code></pre> <p>(but the last two entrires are wrong, that is actually my problem)</p> <p>This is the relevant part of the <code>Gruntfile.js</code>:</p> <pre><code> useminPrepare: { html: '&lt;%= yeoman.app %&gt;/index.html', options: { dest: '&lt;%= yeoman.dist %&gt;' } }, usemin: { html: ['&lt;%= yeoman.dist %&gt;/*.html'], css: ['&lt;%= yeoman.dist %&gt;/styles/*.css'], options: { dirs: ['&lt;%= yeoman.dist %&gt;'] } }, </code></pre> <p>The problem that I have is that both <code>templates.js</code> and <code>neuterapp.js</code> are generated files, so they are not in <code>&lt;%= yeoman.app %&gt;/scripts</code>, but in <code>&lt;%= yeoman.dist %&gt;/scripts</code>.</p> <p>This is my (simplified) directory structure:</p> <pre><code>webapp/ ├── app │   ├── app.js &lt;--- for neuter │   ├── controllers │   ├── index.html │   ├── models │   ├── routes │   ├── scripts │   │   └── vendor &lt;--- for usemin │   ├── templates &lt;--- for ember_templates │   │   ├── template1.hbs │   │   └── template2.hbs │   └── views ├── dist │   ├── index.html │   └── scripts │   ├── neuterapp.js &lt;--- this must also be used for usemin!!! │   └── templates.js &lt;--- this must also be used for usemin!!! └── Gruntfile.js </code></pre> <p>How can I tell <code>usemin</code> to include some generated files?</p> <p>And in case this is needed, these are the configurations of <code>neuter</code> and <code>ember_templates</code>:</p> <pre><code> neuter: { options: { includeSourceURL: true }, '&lt;%= yeoman.dist %&gt;/scripts/neuterapp.js': '&lt;%= yeoman.app %&gt;/app.js' }, ember_templates: { compile: { options: { templateName: function (sourceFile) { return sourceFile.replace(/app\/templates\//, ''); // &lt;%= yeoman.dist %&gt;/scripts/ } }, files: { '&lt;%= yeoman.dist %&gt;/scripts/templates.js': [ '&lt;%= yeoman.app %&gt;/templates/**/*.hbs' ] } } }, </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload