Symfony2/Assetic: Use bundle annotation in asset path for imported HTML files
<p>I am using Symfony 2.8 for my single page web application. I have a file <code>index.html.twig</code> which is supposed to serve all the required resources. Maybe it's obvious, but I want everything to be reloaded every time in the development environment, but not in the production environment. Said required resources is loaded from another bundle's <code>Resources</code> located in the <code>vendor</code> folder.</p>

<p>For this reason, I have configured Assetic in <code>config.yml</code> as stated below:</p>

<pre><code>assetic:
    debug: "%kernel.debug%"
    use_controller:
        enabled: "%kernel.debug%"
    workers:
        cache_busting:
            enabled: "%kernel.debug%"
</code></pre>

<p>(I am assuming that debug is only enabled in the development environment)</p>

<p>I am loading the required CSS/JavaScript like this:</p>

<pre><code>{% stylesheets
    '@StubbornShowaBundle/Resources/public/stubborn.css'
    '@StubbornShowaBundle/Resources/public/showa.css' %}
        &lt;link type="text/css" href="{{ asset_url }}" rel="stylesheet" /&gt;
{% endstylesheets %}
{% javascripts
    '@StubbornShowaBundle/Resources/public/stubborn.js'
    '@StubbornShowaBundle/Resources/public/showa.js' %}
        &lt;script src="{{ asset_url }}"&gt;&lt;/script&gt;
{% endjavascripts %}
</code></pre>

<p>..which seems to be working as intended. However, I also have imported HTML files. Like this one:</p>

<pre><code>&lt;link href="{{ asset('@StubbornShowaBundle/Resources/public/polymer/my-component.html') }}" rel="import"/&gt;
</code></pre>

<p>However, the above code does not work. The <code>@StubbornShowaBundle</code> annotation seems like it is not usable in the <code>asset</code> command. Also, there seems to be no "loop method" (or whatever you want to call that thing for <code>stylesheets</code>, <code>javascripts</code> and <code>images</code>) for HTML imports. If I link to the file in question directly, aside from stooping to an ugly hack that completely breaks uniformity with the surrounding code, I also break the whole Symfony/Assetic automatically taking care of resource reordering system and debugging becomes a mess. How do I solve this in a way that doesn't force me to re-dump the assets every time I change the code while debugging? (Is it possible to solve in a reasonable way?)</p>