Disable minification in Grunt (Yeoman)

I recently started using GruntJS through Yeoman, and I like the idea of ​​Javascript minification, but this creates difficulties during development. I tried to disable uglify, usemin, etc. In different combinations in the Grunt file, but everything seems to depend on another thing and breaks the process. Is there an easy way to disable minimization? I am using the latest version of Grunt proposed by Yeoman to date, I found that older solutions have a different Gruntfile setting than usd with Yeoman.

Here is my grunt file:

// Reads HTML for usemin blocks to enable smart builds that automatically
// concat, minify and revision files. Creates configurations in memory so
// additional tasks can operate on them
useminPrepare: {
  options: {
    dest: '<%= config.dist %>'
  },
  html: '<%= config.app %>/index.html'
},

http://hastebin.com/gicabukojo.js

+4
source share
2 answers

Grunt:

// 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.

, <!-- Usemin block --> index.html useminPrepare grunt- javascript.

, uglify , dev, .min :

 uglify: {
   dist: {
     files: {
       '<%= config.dist %>/scripts/scripts.js': [
         '<%= config.dist %>/scripts/scripts.min.js'
       ]
     }
   }
 },
+1

usemin flow::

yoman grunt usemin fine manual, flow:

{ steps: { js: ['concat', 'uglify'], css: ['concat', 'cssmin'] }, post: {} }

, yo webapp Gruntfile.js, uglify .

+1

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


All Articles