adding js and css to custom templates
I Found the Solution for this.. and it is by using the BareHtmlPageRenderer (found it here) and then attach the files in the controller php file like this 

$build['#attached']['library'][] = 'product_tree/product-tree-libraries';


with out the attachments hook function.

so the controller would look like:

    $build =  array(
        'page' =&gt; array (
            '#theme' =&gt; 'products_tree',
            '#items' =&gt; $term_data,
            '#title' =&gt; 'products', 
        )
    );

    $build['#attached']['library'][] = 'product_tree/product-tree-libraries';



    $attachments = \Drupal::service('html_response.attachments_processor');
    $renderer = \Drupal::service('renderer');

    $bareHtmlPageRenderer = new BareHtmlPageRenderer($renderer, $attachments);

    $response = $bareHtmlPageRenderer-&gt;renderBarePage($build, 'Page Title', 'markup');
    return $response;


it could also be in the $build array it self i think.. but this way its better when looking at it..

and still no need for:

{{ attach_library('product_tree/product-tree-libraries') }}


Or

&lt;link href="css/style.css" rel="stylesheet"&gt;