How do I tell Grunt to NOT minify or concatenate js files in a build task?

只谈情不闲聊 提交于 2019-12-03 13:04:12

Ok, I've edited the default grunt file so that it does what I want.

My solution involved writing tasks called copy:devDist and compass:devDist, and then combining them into a devDist task.

//
//  copy:devDist --> copies everything into the dist folder, except styles/
//
    copy: {
      [...]
      devDist: {         
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '**','!styles/**'   // everything but styles/
          ]
        }]
      }
    },



//
//  compass:devDist --> compile the sass; put result in dist/styles/
//
    compass: {
      [...]
      devDist: {
        options: {
          cssDir: '<%= yeoman.dist %>/styles'  
        }
      }
    },




  //
  // register a 'devDist' task that calls the two tasks above
  //
  grunt.registerTask('devDist', [
    'clean:dist',
    'copy:devDist',
    'compass:devDist'
  ]);

Now running grunt devDist compiles my css and puts a fully functional app into my dist folder. Excellent. :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!