question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

usemin option doesn't work

See original GitHub issue

Hi, trying to append templates to final script file via usemin option but it doesn’t work:

(I’m using Yeoman)

Here is HTML snippet

        <!-- build:js({.tmp,app}) scripts/scripts.js -->
        <script src="scripts/app.js"></script>
        <script src="scripts/controllers/main.js"></script>
        <!-- endbuild -->

Gruntfile:

  // compiles templates to cache
      ngtemplates: {
          dist: {
              options: {
                  module: 'testApp',
                  usemin: 'scripts/scripts.js'
              },
              cwd: '<%= yeoman.app %>',
              src: 'views/**/*.html',
              dest: '<%= yeoman.app %>/scripts/templates.js'
          }
      }
...
...
// build task
grunt.registerTask('build', [
    'clean:dist',
    'bower-install',
    'useminPrepare',
    'ngtemplates',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'rev',
    'usemin',
    'htmlmin'
  ]);

when running task:

$ grunt build

grunt throws this error:

Running "ngtemplates:dist" (ngtemplates) task
File dist/scripts/templates.js created.
>> Could not find usemin.generated path matching: scripts/scripts.js

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
abe312commented, May 13, 2018

resolved this issue. Looks like I was missing <!-- endbuild --> in the js section of index.html

Please recheck the same. Hope it solves the problem 😃

1reaction
ericclemmonscommented, Jan 14, 2016

Very good point! Which one worked? \ or \\?

  • Instruct Windows users to use backslashes for usemin paths for everything to work
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does usemin not accept --htmlmin option? - Stack Overflow
I'm building a distribution copy of a website using npm usemin with --htmlmin option. Running script below from package.json and I expect to ......
Read more >
usemin - npm
Extract information from a HTML input file to be processed later. This does not process any files (i.e., it doesn't perform uglify or...
Read more >
gulp-usemin | Yarn - Package Manager
gulp-usemin ... Replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views). This task is designed for...
Read more >
min-width - CSS: Cascading Style Sheets - MDN Web Docs
Setting minimum element width. table { min-width: 75%; } form { min-width: 0; } Copy to Clipboard. Specifications. Specification ...
Read more >
How to Use min() and max() in R - DigitalOcean
How to Use min() and max() in R ... Let's see how it works! ... The max function won't return any values if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found