how to minify js files in order via grunt-contrib-uglify?

后端 未结 9 2217
执念已碎
执念已碎 2021-02-01 14:51

I have a directory like below:

/folder/b.js
/folder/jQuery.js
/folder/a.js
/folder/sub/c.js

I want to minify all these js files in one js file

9条回答
  •  不知归路
    2021-02-01 15:29

    This can be done using the following Grunt tasks:

    1. https://github.com/gruntjs/grunt-contrib-concat concatenates files
    2. https://github.com/gruntjs/grunt-contrib-uglify minifies concatenated files

    EDIT

    I usually run all my files through a Grunt concatenation task using grunt-contrib-concat. Then I have another task to uglify the concatenated file using grunt-contrib-uglify.

提交回复
热议问题