title: Laravel Mix - Is Chaining Required to Ensure Execution Order?
body: <h1>TLDR;</h1>
  
  <p>Do you have to chain Laravel Mix methods to maintain the execution order? Are any methods async that would prevent one from using the following non-chaining pattern, <code>mix.scripts(); mix.js(); mix.sass();</code>?</p>
  
  <p>The few tests I've run suggest I do not need to chain.</p>
  
  <h1>An Example</h1>
  
  <p>Due to how our Laravel app is setup, we need to have more that one Laravel Mix setup. Instead of copy-n-pasting a <code>webpack.mix.js</code> file and modifying a few lines here and there in each file, we're looking at creating a config object that is passed to a singular <code>webpack.mix.js</code> file. In this file, we would check if various things have been configured, and if so, run the appropriate Mix method. Below is a pseudo-code example.</p>
  
  <pre><code>if ( config.js ) {
    mix.js( config.js.src, config.js.dist );
  }
  
  if ( config.sass ) {
    mix.sass( config.sass.src, config.sass.dist );
  }
  
  if ( config.concat ) {
  
    if ( config.concat.styles ) {
  
      // Could be more than one set of files that need to be combined, so array.
      config.concat.styles.map( ( files ) =&gt; {
        mix.styles( files.src, files.dist );
      }
    }
  
    if ( config.concat.scripts ) {
  
      // Could be more than one set of files that need to be combined, so array.
      config.concat.scripts.map( ( files ) =&gt; {
        mix.scripts( files.src, files.dist );
      }
    }
  
  }
  </code></pre>
  
  <p>Currently, our code is more like most examples you see on the web.</p>
  
  <pre><code>mix
    .options()
    .webpackConfig()
    .styles()
    .styles()
    .scripts()
    .js()
    .sass();
  </code></pre>