Uglify one JS file using requirejs optimizer

前端 未结 3 1149
自闭症患者
自闭症患者 2021-01-21 19:51

I\'d like to know if there is a way to uglify only one file in command line using r.js (RequireJS Optimizer) which is already installed in my computer. Like we can minify a css

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-21 20:34

    put the file in a folder

    run r.js from inside that folder:

    node r.js -o baseUrl=. name=main out=main-built.js
    

    you do not have an internet connection on that computer, isnt it just easyer to put the file on something like an usb sitck and uglify it on a computer that has internet?

提交回复
热议问题