Josee9988 / MinifyAll

A 𝗩𝗦𝗖𝗼𝗱𝗲 𝗺𝗢𝗻𝗢𝗳𝗢𝗲𝗿 for JS, JSON/C, CSS, and HTML, you will love its simplicity! 🌟 π˜Ύπ™€π™’π™₯π™§π™šπ™¨π™¨ and π™œπ™―π™žπ™₯ files and folders πŸ“¦ Reduce your bundle and file sizes with lightning speed ⚑
https://minifyall.jgracia.es/
GNU General Public License v3.0
71 stars 13 forks source link

Removing code on minify in js #73

Closed aavinseth closed 3 years ago

aavinseth commented 3 years ago

Blank Issue Report

Describe the issue

I have enabled setting Minify On Save To New FIle. In minified file its also removing the function call which is present in original.

Original Code:

this.access = function (ucsb_access,udata) {
                switch (ucsb_access) {
                    case 'college':
                        $('.ucsb.'+ucsb_access).val(udata.uc);
                        ucsb('college','auto',{uc:udata.uc,us:udata.us,ub:udata.ub,usm:udata.usm});
                        break;
                    case 'stream':
                        $('.ucsb.'+ucsb_access).val(udata.us);
                        ucsb('stream','auto',{uc:udata.uc,us:udata.us,ub:udata.ub,usm:udata.usm});
                        break;
                    default:
                        break;
                }
            }

Minified Code:

this.access = function(t, a) {
                switch (t) {
                    case "college":
                        $(".ucsb." + t).val(a.uc), e("college", "auto", {
                            uc: a.uc,
                            us: a.us,
                            ub: a.ub,
                            usm: a.usm
                        });
                        break;
                    case "stream":
                        $(".ucsb." + t).val(a.us), e("stream", "auto", {
                            uc: a.uc,
                            us: a.us,
                            ub: a.ub,
                            usm: a.usm
                        });
                        break;
                    default:
                        break
                }
            }

As you can see ucsb() function is removed in minified in case college and stream *


Media prove


Your environment


Additional context

*

issue-label-bot[bot] commented 3 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

Josee9988 commented 3 years ago

This is a problem with Terser, so you should post an issue in their repository.

Thanks for the issue and sorry for not being able to help you!