[Solved] How to run UglifyJS2 without Node.JS

Anyway to run UglifyJS2 without node.js? Say I would like to run it in a JVM process using JavaScript script engine. How to do that?

Solution #1:

I saw mishoo answered you

Two possible ways:

  • run uglifyjs --self to get a build of UglifyJS that you can load in a browser (or in any JS environment) and you can use the API described here.
  • load in your environment all files in the lib/ directory (load utils.js and ast.js first, the others can come in whatever order). If you do this, everything will be global—you can use the same API but there’s no need to prefix stuff with UglifyJS..

Also you might want to look at tools/node.js to see how we load it in Node (as we’re not using the standard require).

Respondent: corbacho
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy