Minify multiple files with UglifyJS

后端 未结 3 2047
温柔的废话
温柔的废话 2021-01-30 11:11

Is it possible to compress multiple files with UglifyJS?

Something like...

uglifyjs -o app.build.js appfile1.js appfile2.js ...

Also, I

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 11:41

    Actually what you want to do (trick it into thinking its just 1 file) is just cat it

    Linux

    cat file1.js file2.js file3.js file4.js | uglifyjs -o files.min.js
    

    Windows (untested)

    type file1.js file2.js > uglifyjs -o files.min.js
    

    OR

    type file1.js file2.js > merged.files.js
    uglifyjs -o merged.files.js
    

提交回复
热议问题