title: Why first line `import jQuery from "../core.js";` is included in `load.js` even though it is already included in `jquery.js`
body: <p>I was just going through jQuery's source code. But then I came across the <a href="https://github.com/jquery/jquery/blob/main/src/ajax/load.js" rel="nofollow noreferrer">following file</a>:</p>
  <h2><a href="https://github.com/jquery/jquery/blob/main/src/ajax/load.js" rel="nofollow noreferrer">load.js</a></h2>
  <pre class="lang-js prettyprint-override"><code>import jQuery from &quot;../core.js&quot;;
  import stripAndCollapse from &quot;../core/stripAndCollapse.js&quot;;
  
  import &quot;../core/parseHTML.js&quot;;
  import &quot;../ajax.js&quot;;
  import &quot;../traversing.js&quot;;
  import &quot;../manipulation.js&quot;;
  import &quot;../selector.js&quot;;
  
  /**
   * Load a url into a page
   */
  jQuery.fn.load = function( url, params, callback ) {
      var selector, type, response,
          self = this,
          off = url.indexOf( &quot; &quot; );
  
      if ( off &gt; -1 ) {
          selector = stripAndCollapse( url.slice( off ) );
          url = url.slice( 0, off );
      }
  
      // If it's a function
      if ( typeof params === &quot;function&quot; ) {
  
          // We assume that it's the callback
          callback = params;
          params = undefined;
  
      // Otherwise, build a param string
      } else if ( params &amp;&amp; typeof params === &quot;object&quot; ) {
          type = &quot;POST&quot;;
      }
  
      // If we have elements to modify, make the request
      if ( self.length &gt; 0 ) {
          jQuery.ajax( {
              url: url,
  
              // If &quot;type&quot; variable is undefined, then &quot;GET&quot; method will be used.
              // Make value of this field explicit since
              // user can override it through ajaxSetup method
              type: type || &quot;GET&quot;,
              dataType: &quot;html&quot;,
              data: params
          } ).done( function( responseText ) {
  
              // Save response for use in complete callback
              response = arguments;
  
              self.html( selector ?
  
                  // If a selector was specified, locate the right elements in a dummy div
                  // Exclude scripts to avoid IE 'Permission Denied' errors
                  jQuery( &quot;&lt;div&gt;&quot; ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  
                  // Otherwise use the full result
                  responseText );
  
          // If the request succeeds, this function gets &quot;data&quot;, &quot;status&quot;, &quot;jqXHR&quot;
          // but they are ignored because response was set above.
          // If it fails, this function gets &quot;jqXHR&quot;, &quot;status&quot;, &quot;error&quot;
          } ).always( callback &amp;&amp; function( jqXHR, status ) {
              self.each( function() {
                  callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
              } );
          } );
      }
  
      return this;
  };
  </code></pre>
  <h2><a href="https://github.com/jquery/jquery/blob/main/src/jquery.js" rel="nofollow noreferrer">jquery.js</a></h2>
  <pre class="lang-js prettyprint-override"><code>import jQuery from &quot;./core.js&quot;;
  
  import &quot;./selector.js&quot;;
  import &quot;./traversing.js&quot;;
  import &quot;./callbacks.js&quot;;
  import &quot;./deferred.js&quot;;
  import &quot;./deferred/exceptionHook.js&quot;;
  import &quot;./core/ready.js&quot;;
  import &quot;./data.js&quot;;
  import &quot;./queue.js&quot;;
  import &quot;./queue/delay.js&quot;;
  import &quot;./attributes.js&quot;;
  import &quot;./event.js&quot;;
  import &quot;./event/trigger.js&quot;;
  import &quot;./manipulation.js&quot;;
  import &quot;./manipulation/_evalUrl.js&quot;;
  import &quot;./wrap.js&quot;;
  import &quot;./css.js&quot;;
  import &quot;./css/hiddenVisibleSelectors.js&quot;;
  import &quot;./css/showHide.js&quot;;
  import &quot;./serialize.js&quot;;
  import &quot;./ajax.js&quot;;
  import &quot;./ajax/xhr.js&quot;;
  import &quot;./ajax/script.js&quot;;
  import &quot;./ajax/jsonp.js&quot;;
  import &quot;./ajax/load.js&quot;;
  import &quot;./core/parseXML.js&quot;;
  import &quot;./core/parseHTML.js&quot;;
  import &quot;./effects.js&quot;;
  import &quot;./effects/animatedSelector.js&quot;;
  import &quot;./offset.js&quot;;
  import &quot;./dimensions.js&quot;;
  import &quot;./deprecated.js&quot;;
  import &quot;./exports/amd.js&quot;;
  import &quot;./exports/global.js&quot;;
  
  export default jQuery;
  </code></pre>
  <p>I understand that the file <code>load.js</code> is being imported to <code>jquery.js</code> for its side-effects only and <code>load.js</code> doesn't export anything. But what I didn't understand is that why first line <code>import jQuery from &quot;../core.js&quot;;</code> is included in <code>load.js</code> even though it is already included in <code>jquery.js</code>. If <code>jquery.js</code> already imports both <code>core.js</code> and <code>load.js</code> then why does <code>load.js</code> also have to import the same <code>core.js</code>?</p>
  <p><em>If this question isn't appropriate here, please migrate this to another appropriate place.</em></p>