Attaching two or more jQuery files to a theme I was trying to add some jQuery files to a theme (to do some simple css logics). I could add one jQuery file by defining as follows

In the custom theme folder I edited themes.libraries.yml and added the following

global-scripts:
  js:
    js/jqueryfile1.js: {}
  dependencies:
    - core/jquery


and then I wrote my jquery code within inside custom_theme_folder/js/jqueryfile1.js as

(function ($){
Drupal.behaviors.myModuleBehavior = {
    attach: function(context, settings) {
        $(document).ready(function(){

            //code goes here

            });
        });
    }
};
})(jQuery);


Everything was fine till now. But when I'm trying to add my next file(jqueryfile2.js) only the the latest (jqueryfile2.js) is taking in action. I can see the previous file is also called in the DOM while checking the source but the code is not executing. After adding my second jQuery my libraries.yml will look like

global-scripts:
  js:
    js/jqueryfile1.js: {}
    js/jqueryfile2.js: {}
  dependencies:
    - core/jquery


At this point jqueryfile2.js is only taking in action not the first file. And there will be both my jquery files within inside the js folder and is called to the document.
By default, multiple local files will be aggregated where possible. To disable this for a file, set its 'preprocess' flag to false.

mymodule:
  version: 1.x
  js:
    js/custom.js: {preprocess: false}
  dependencies:
    - core/jquery
    - core/jquery.ui