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

pipeline compression skips over js when using yuglify #768

Open
esskaey opened this issue Jul 13, 2022 · 2 comments
Open

pipeline compression skips over js when using yuglify #768

esskaey opened this issue Jul 13, 2022 · 2 comments
Labels

Comments

@esskaey
Copy link

esskaey commented Jul 13, 2022

Hi there,

I am a bit new to using js. I am having a strange output, where the functions inside a js file are being skipped over during compression using yuglify. I am getting no errors, except when checking the output the functions are not present!

The file which is being ignored

// application.js
function changeValueProp() {
    if (document.getElementById('ShowHideProp').value == 'Show Properties'){
      document.getElementById('ShowHideProp').value = 'Hide Properties';
    }
    else{
      document.getElementById('ShowHideProp').value = 'Show Properties';
    }
  }

In my pipeline config I am using

{
    "JAVASCRIPT": {
     "application": {"source_filenames":  (f'{APP_STATIC_DIR}/application.js',f'{APP_STATIC_DIR}/application01.js',),
                             "output_filename":    'compressed/js/application.js'},
                          },
    "YUGLIFY_BINARY": f"{BASE}/node_modules/yuglify/bin/yuglify",
}

I just checked that if I use "DISABLE_WRAPPER":True, the function from application.js is compressed and put in the output file.
In ReadTheDocs, the DISABLE_WRAPPER:False is recommended for improving performance.

Is it possible to use the wrapper without it skipping over the js described above ?

BR

SK

@esskaey esskaey changed the title compression skips over js when yuglify pipeline compression skips over js when using yuglify Jul 13, 2022
@peymanslh
Copy link
Member

peymanslh commented Feb 25, 2023

I think it's because yuglify skips functions that aren't used in your code.
It's better to take a look at yuglify documentation.

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

No branches or pull requests

3 participants
@peymanslh @esskaey and others