Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mangle Props on uglifyjs2 configuration #868

Open
cybermak opened this issue Dec 22, 2017 · 1 comment
Open

Add Mangle Props on uglifyjs2 configuration #868

cybermak opened this issue Dec 22, 2017 · 1 comment

Comments

@cybermak
Copy link

cybermak commented Dec 22, 2017

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');
        }

       ...
}
@jamesanderson9182
Copy link

@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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants