如何配置grunt.js以单独minify文件 [英] how to config grunt.js to minify files separately

查看:105
本文介绍了如何配置grunt.js以单独minify文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在静态中有一些js文件/ js /

there are some js files in static/js/

    1. a.js
    2. b.js
    3. c.js   

如何配置grunt.js获取以下文件:

how to config grunt.js to get below files:

    1. a.min.js
    2. b.min.js
    3. c.min.js

到目前为止,我必须键入特定的文件名:

as far, I have to type specific file name:

  min: {
    dist: {
    src:  'js/**/*.js',
    dest: 'js/min/xxx.min.js'
   }
 }


推荐答案

遇到同样的问题,并找到一个解决方案,可以自动缩小我的所有脚本:

Had the same problem and found a solution that would automatically minify all my scripts separately:

uglify: {
      build: {
        files: [{
            expand: true,
            src: '**/*.js',
            dest: 'build/scripts',
            cwd: 'app/scripts'
        }]
      }
    }

这篇关于如何配置grunt.js以单独minify文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆