title: Where to define different asset files for dev/prod mode? - Yii2
body: <p>I would like to use different js files for development and production mode in Yii2. The development mode has lot of files unminified, although the production would have a single file.</p>
  
  <p>The development asset goes like this:</p>
  
  <pre><code>namespace frontend\assets;
  use yii\web\AssetBundle;
  
  class AppAsset extends AssetBundle {
      public $basePath = '@webroot';
      public $baseUrl = '@web';
      public $css = [
          'css/main.css',
      ];
      public $js = [
          'js/app/_variables.js',
          'js/app.js',
          'js/app/_api_conn.js',
          'js/app/_docCookies.js',
          'js/app/ ..... .js',
      ];
      public $depends = [
          'yii\bootstrap\BootstrapPluginAsset',
      ];
  }
  </code></pre>
  
  <p>And I would like to have this particular bundle like this in production mode, already merged and minified locally:</p>
  
  <pre><code>namespace frontend\assets;
  use yii\web\AssetBundle;
  
  class AppAsset extends AssetBundle {
      public $basePath = '@webroot';
      public $baseUrl = '@web';
      public $css = [
          'css/main.css',
      ];
      public $js = [
          'js/wfapp_all_min.js',
      ];
      public $depends = [
          'yii\bootstrap\BootstrapPluginAsset',
      ];
  }
  </code></pre>
  
  <p>As the <a href="http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#customizing-asset-bundles" rel="nofollow">Yii2 documentation</a> explains there is a single method to do this, but I can't find out, where to add it (the example is for jquery asset, but seems right method for my case as well):</p>
  
  <pre><code>'yii\web\JqueryAsset' =&gt; [
      'js' =&gt; [
          YII_ENV_DEV ? 'jquery.js' : 'jquery.min.js'
      ]
  ],
  </code></pre>
  
  <p>So what is the proper way to implement this? Thanks in advance!</p>