kriswallsmith/assetic

Add Mangle Props on uglifyjs2 configuration

cybermak opened this issue · 1 comments

symfony/assetic-bundle/Resources/config/filters/uglifyjs2.xml:        

        <parameter key="assetic.filter.uglifyjs2.mangle">false</parameter>
        <parameter key="assetic.filter.uglifyjs2.mangle-props">false</parameter>

            <call method="setMangle"><argument>%assetic.filter.uglifyjs2.mangle%</argument></call>
            <call method="setMangleProps"><argument>%assetic.filter.uglifyjs2.mangle_props%</argument></call>

kriswallsmith/assetic/src/Assetic/Filter/UglifyJs2Filter.php:    

    private $mangle;
    private $mangleProps;

    public function setMangle($mangle)
    {
        $this->mangle = $mangle;
    }

    public function setMangleProps($mangleProps)
    {
        $this->mangleProps = $mangleProps;
    }

    public function filterDump(AssetInterface $asset)
    {

        ....

        if ($this->mangle) {
            $pb->add('--mangle');
        }

        if ($this->mangleProps) {
            $pb->add('--mangle-props');
        }

       ...
}

@cybermak I have created a pull request with your change.

The Travis builds no longer pass because this repository has become slightly out of date.

If you want to be able to use this, modify the following in your composer.json file which is my commit of the fork. If this ever gets merged in you should change it back to what you had previously. You may encounter an issue with composer telling you that this this does not satisfy your minimum stability, update your stability at your own risk.

James

"jamesanderson9182/assetic": "dev-master#d3a7827"