title: How to use JSX file in Yii2 Asset Bundle
body: <p>I have Yii2 project setup and I've decided to use Facebook's JavaScript framework <a href="https://facebook.github.io/react/" rel="nofollow">React.js</a> which provided a convenient way to declare HTML templates inside JavaScript code, called <a href="http://facebook.github.io/jsx/" rel="nofollow">JSX</a>.</p>
  
  <p>My JavaScript looks as following:</p>
  
  <pre><code>(function () {
      'use strict';
  
      MyBlock = React.createClass({
          getInitialState: function () {
              return {data: []};
          },
          componentDidMount: function () {
              $.ajax({
                  url: '/api/',
                  dataType: 'json',
  
                  success: function (data) {
                      this.setState({ data: data });
                  }.bind(this)
              });
          },
  
          render: function () {
              &lt;div class="block"&gt;
                  {this.props.variable}
              &lt;/div&gt;
          }
      });
  
      React.render(
          &lt;ProfileQuestion /&gt;,
          document.getElementById('profile_question_wrapper')
      );
  }());
  </code></pre>
  
  <p>AssetBundle helps me to include required libraries in my view, so I added React.JS and JSX file from CDN into my AssetBundle:</p>
  
  <pre><code>class MyAsset extends AssetBundle
  {
      public $basePath = '@webroot';
      public $baseUrl = '@web';
      public $css = [
      ];
      public $js = [
          '//fb.me/react-0.13.1.min.js',
          '//fb.me/JSXTransformer-0.13.1.js',
          'js/app.jsx',
      ];
      public $depends = [
          'app\assets\AppAsset'
      ];
  }
  </code></pre>
  
  <p>However, when it adds the script in the bottom of my page it shows it as </p>
  
  <pre><code>&lt;script src="/js/app.jsx"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>and doesn't mark the type of the script as <code>text/jsx</code> therefore JSX Transform library doesn't recognize JSX syntax and the .jsx file interprets as simple JavaScript, throwing syntax error message on JSX style.</p>
  
  <pre><code>SyntaxError: Unexpected token '&lt;'
  </code></pre>
  
  <p>Is there any way to specify in AssetBundle that .jsx file should have type of <code>text/jsx</code> in script element, when rendered?</p>