Skip to content

Commit

Permalink
[jan] Fix calling UglifyJS compressor.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Dec 10, 2014
1 parent e761f58 commit 4000caa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Expand Up @@ -52,14 +52,8 @@ public function minify()
return parent::minify();
}

$cmd = escapeshellcmd($this->_opts['uglifyjs']);
if (isset($this->_opts['sourcemap']) && is_array($this->_data)) {
$this->_sourcemap = Horde_Util::getTempFile();
$cmd .= ' --source-map ' .
escapeshellarg($this->_sourcemap) .
' --source-map-url ' .
escapeshellarg($this->_opts['sourcemap']);
}
$cmd = escapeshellcmd($this->_opts['uglifyjs'])
. ' ' . $this->_opts['cmdline'];

if (is_array($this->_data)) {
$js = '';
Expand All @@ -73,7 +67,7 @@ public function minify()
$cmdline = new Horde_JavascriptMinify_Util_Cmdline();
return $cmdline->runCmd(
$js,
trim($cmd . ' ' . $this->_opts['cmdline']),
trim($cmd),
$this->_opts['logger']
) . $this->_sourceUrls();
}
Expand Down
4 changes: 2 additions & 2 deletions framework/JavascriptMinify/package.xml
Expand Up @@ -21,7 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Fix calling UglifyJS compressor.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -146,7 +146,7 @@
<date>2014-12-03</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Fix calling UglifyJS compressor.
</notes>
</release>
</changelog>
Expand Down

5 comments on commit 4000caa

@joaomachado
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was fixed?
Only see sourcemap feature lost...
Can you add it again?

@yunosh
Copy link
Member Author

@yunosh yunosh commented on 4000caa Dec 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It creates the source map automatically, those command line arguments don't even exist.

@joaomachado
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know how...
I'm going to keep my local revert. Thanks

@yunosh
Copy link
Member Author

@yunosh yunosh commented on 4000caa Dec 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I'm using version 1.3.5 which is the latest stable version. UglifyJS2 has a different interface and should be considered a different backend.

@slusarz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. Installing via npm, version 2 is explicitly marked as stable/active -- you actually have to add specific version information to the install string to install the old, deprecated/unsupported version 1 edition.

I would agree that the two versions could use a different driver, but this driver was explicitly written for the stable/current package (i.e. version 2).

Please sign in to comment.