title: yii2 + babel how realize
body: <p>I need to transpile a couple of files and then get them <strong>instead of</strong> original files.<br>
  I write about babel, and (as for me), this is a good solution.  </p>
  
  <hr>
  
  <p>My variant is<br>
  1. to do some set of files in <code>babel.config.json</code><br>
  2. transpile them to <code>someDir</code><br>
  3. in asset do logic, like   </p>
  
  <pre class="lang-php prettyprint-override"><code>if(YII_ENV == 'dev')
  {
      // change sourcePath to `someDir` 
  }
  </code></pre>
  
  <p>But I sure that this is not a good solution at all</p>
  
  <hr>
  
  <p>So, can you say/show a better way of this</p>