1

I use latest PhpStorm 2017.2.3 and latest uglify.js. In my Toolsettings id do this:

enter image description here

Than i add a testfile (test.js) in the module dir and take some code inside:

function test () {
var messsage = 'hello world';
alert(messsage);
}

The uglify result is this:

function test(){var messsage="hello world";alert(messsage)}

The tool don't minified the code, it only bring it in one line! What i have to change in my settings to minify js-code?

S.Chrobak
  • 105
  • 1
  • 9

1 Answers1

3

Add in the end of "Arguments:" from docs:

-c -m

and You'll get:

$FileName$ -o $FileNameWithoutExtension$.min.js -c -m

Your code:

function test () {
  var messsage = 'hello world';
  alert(messsage);
}

will transform to:

function test(){alert("hello world")}
DmitriyK
  • 31
  • 2