Errors when starting the Grunt build for the first time

I created an angularJS project using Yeoman

Previewing the application using grunt serveworks well. The server starts up and I can successfully browse my pages.

When executed, grunt buildI get

Running "cdnify:dist" (cdnify) task
Going through dist/404.html, dist/index.html to update script refs
>> No "cssmin" targets found.
Warning: Task "cssmin" failed. Use --force to continue.

Aborted due to warnings.

What I do not know how to fix, or how to start. Am I missing some configurations?

Now setup:

  concat:
  { generated:
   { files:
      [ { dest: '.tmp\\concat\\scripts\\scripts.js',
          src:
           [ '{.tmp,app}\\cdnjs.cloudflare.com\\ajax\\libs\\noUiSlider\\5.0.0\\jquery.nouislider.min.js',
             .
             <MY_LIBRARIES>, 
             .] },
        { dest: '.tmp\\concat\\scripts\\modules.js',
          src:
           [ 'app\\scripts\\app.js',
             .
            <MY_SOURCE_FILES>, 
            . ] } ] } }

  uglify:
  { generated:
   { files:
      [ { dest: 'dist\\scripts\\scripts.js',
          src: [ '.tmp\\concat\\scripts\\scripts.js' ] },
        { dest: 'dist\\scripts\\modules.js',
          src: [ '.tmp\\concat\\scripts\\modules.js' ] } ] } }

  cssmin:
  {}

Running "concurrent:dist" (concurrent) task

Running "imagemin:dist" (imagemin) task
? app/images/yeoman.png (saved 9.06 kB)
Minified 1 image (saved 9.06 kB)

Done, without errors.

Running "svgmin:dist" (svgmin) task

Done, without errors.

Running "compass:dist" (compass) task
directory .tmp/styles/
       create .tmp/styles/bootstrap.css (1.739s)
       create .tmp/styles/main.css (0.129s)
       create .tmp/styles/problem-comprehension.css (0.002s)
       create .tmp/styles/problem-timedword.css (0.002s)
       create .tmp/styles/track-detail.css (0.009s)
    Compilation took 1.894s

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
Prefixed file ".tmp/styles/bootstrap.css" created.
Prefixed file ".tmp/styles/main.css" created.
Prefixed file ".tmp/styles/problem-comprehension.css" created.
Prefixed file ".tmp/styles/problem-timedword.css" created.
Prefixed file ".tmp/styles/track-detail.css" created.

Running "concat:generated" (concat) task
File ".tmp\concat\scripts\scripts.js" created.
File ".tmp\concat\scripts\modules.js" created.

Running "ngmin:dist" (ngmin) task
ngminifying .tmp/concat/scripts/modules.js, .tmp/concat/scripts/scripts.js

Running "copy:dist" (copy) task
Created 699 directories, copied 1980 files

Running "cdnify:dist" (cdnify) task
Going through dist/404.html, dist/index.html to update script refs
>> No "cssmin" targets found.
Warning: Task "cssmin" failed. Use --force to continue.

Aborted due to warnings.


Execution Time (2014-02-06 19:49:33 UTC)
clean:dist           1.3s  ■■■■■■■■■■■ 8%
useminPrepare:html  169ms  ■■ 1%
concurrent:dist      5.3s  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 33%
ngmin:dist           2.3s  ■■■■■■■■■■■■■■■■■■■ 14%
copy:dist            6.8s  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 42%
Total 16.1s
+4
source share
3 answers

Yeoman from the box configuration requires some configuration. cssmin is part of the build task when it is commented out. Since "usemin" is specified later, I just deleted it from the task.

+3
source

css ,

<!-- build:css(.) styles/vendor.css -->
    <!-- Bootstrap -->
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">

<!-- endbuild -->
<!-- build:css(.tmp) styles/main.css -->
    <link rel="stylesheet" href="styles/styles.css">
<!-- endbuild -->
+1

Gruntfile.js, :

// By default, your `index.html` <!-- Usemin block --> will take care
// of minification. These next options are pre-configured if you do not
// wish to use the Usemin blocks.

So, you leave the block in HTML or uncomment in Gruntfile.js! It took a little time to figure this out, since I immediately cleared my HTML, but now it works like a charm!

0
source

Source: https://habr.com/ru/post/1525683/


All Articles