-2

I have a question to which I could not find a good answer to.

What is the difference between the minified output of a JavaScript file or a CSS file concernic the pictures below.

enter image description here

In this picture the output is on few rows and you have a horizontal scroll bar to see the rest of the code.

enter image description here

In the second picture, the same code with the result being shown on the actual row lenght, but with many more lines of code.

Is there an actual difference between the 2 situations, are they affecting the performance of the website and does the out of these files result from which program you are using? (I am using WRO4J and the result is always as in the second picture.

I've made an update of the question with the Source file. And the way it appears, does not look like a normal minified js code.

The jQuery is on 3 rows but there is alot of spacing on my other js code enter image description here

3
  • 1
    am pretty sure both are the same but your editor is adding line break to show you the full file, it's a common thing Aug 9, 2018 at 11:50
  • 1
    It's simply due to the word wrap setting of however you're displaying them. The files are probably the same Aug 9, 2018 at 11:51
  • ty for the answers, I've updated the questio nregarding the source code, any thoughts? Aug 9, 2018 at 12:25

2 Answers 2

3

This might be happening because of page wrap. Normally, Sublime text or any text editor with page wrap option enabled, wraps all your code into the viewable area of the window and adds a vertical scrollbar if necessary.

And to answer your other part of question, no it doesn't affect the performance

4
  • ty for the answer, I've updated the questio nregarding the source code, any thoughts? Aug 9, 2018 at 12:25
  • It depends on the tool that was used to minify, some tools remove almost all line breaks, while others simply choose to ignore. Aug 9, 2018 at 12:26
  • I am using WRO4J on a hybris platform, so I guess the tool needs some backend twitching to perform better Aug 9, 2018 at 12:34
  • Yes, maybe you need it Aug 9, 2018 at 12:39
1

It's just the visual, not the performance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.