Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use well ngmin for annotate angularjs files and usemin to produce a dist file
    primarykey
    data
    text
    <p>I'm using a yeoman web app template that runs an AngularJS app. <code>usemin</code> is great, but AngularJS files must be pre-processed with <code>ngmin</code> to be annotated before being uglified and minified by <code>usemin</code>.</p> <p>I can produce a single, concatenated file of annotated AngularJS controllers, directives, services, etc. using <code>ngmin</code>.</p> <pre><code> ngmin: { build: { src: ['&lt;%= yeoman.app %&gt;/js/one.js','&lt;%= yeoman.app %&gt;/js/two.js'], dest: '&lt;%= yeoman.dist %&gt;/ng/annotated.js' } } </code></pre> <p>Basically I run a build that successfully created <code>annotated.js</code>.</p> <p>What I want is declare <code>annotated.js</code> file in <code>index.html</code> to inform <code>usemin</code> to use that file only for <strong>distribution</strong>, not the ones I mention for <strong>development</strong>.</p> <pre><code> &lt;!-- build:js js/app.min.js --&gt; //annotated.js only must be processed instead of those 2 files. &lt;script src="js/one.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/two.js" type="text/javascript"&gt;&lt;/script&gt; &lt;!-- endbuild --&gt; </code></pre> <p>For reference, my usemin config:</p> <pre><code> useminPrepare: { options: { dest: '&lt;%= yeoman.dist %&gt;' }, html: '&lt;%= yeoman.app %&gt;/index.html' }, usemin: { options: { dirs: ['&lt;%= yeoman.dist %&gt;'] }, html: ['&lt;%= yeoman.dist %&gt;/{,*/}*.html'], css: ['&lt;%= yeoman.dist %&gt;/css/{,*/}*.css'] } </code></pre> <p>For reference, my build task:</p> <pre><code>grunt.registerTask('build', [ 'clean:dist', 'useminPrepare', 'concat', 'cssmin', 'ngmin', 'uglify', 'copy:dist', 'rev', 'usemin' ]); </code></pre> <p>How can I achieve it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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