Minify multiple files with UglifyJS

后端 未结 3 2050
温柔的废话
温柔的废话 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:34

    No.

    but as other answers states, in it current form, it can concatenate all of them in the same output. Which is not the same as is being asked.

    If you have a dozen files that are individual modules. You can not uglify them all at the same time. Which is desirable because you save build time to start nodejs every time.

    yuicompressor allows this, and the time saved by not starting up a jvm for each individual file is great. And in the end you do get file1-min.js, file2-min.js, etc... not one concatenated blob.

    With uglify you will have to spawn one process per file if you do not want to concatenate output.

提交回复
热议问题