title: Render twig template into html file using command in terminal
body: <p>I am fan of webpack there is also <a href="https://github.com/emilnordh/webpack-twig-loader" rel="nofollow">webpack-twig-loader</a>, but it is unclear how it is working.</p>
  
  <p>I want to run command in terminal like:</p>
  
  <pre><code>twigrender index.twig data.json
  </code></pre>
  
  <ul>
  <li>which will output index.html from index.twig template using data from data.json as template variables.</li>
  </ul>
  
  <p>Is that possible using for example webpack's webpack-twig-loader or <a href="https://www.npmjs.com/package/twig" rel="nofollow">twig</a> npm package? </p>
  
  <p>Or can it be run using PHP in command line?</p>
  
  <p>Next step would be using webpack dev server for autoloading to for twig templates, javascript and css.</p>