title: How to read in files with a specific file ending at compile time in nim?
body: <p>I am working on a desktop application using nim's <a href="https://github.com/juancarlospaco/webgui" rel="nofollow noreferrer">webgui</a> package, which sort of works like electron in that it renders a gui using HTML + CSS + JS. However, instead of bundling its own browser and having a backend in node, it uses the browser supplied by the OS (Epiphany under Linux/GNOME, Edge under Windows, Safari under iOS) and allows writing the backend in nim.</p>
  <p>In that context I am basically writing an SPA in Angular and need to load in the HTML, JS and CSS files at compile-time into my binary.
  Reading from a known absolute filepath is not an issue, you can use nim's <code>staticRead</code> method for that.
  However, I would like to avoid having to adjust the filenames in my application code all the time, e.g. when a new build of the SPA changes a file name from <code>main.a72efbfe86fbcbc6.js</code> to <code>main.b72efbfe86fbcbc6.js</code>.</p>
  <p>There is an iterator in <code>std/os</code> that you can use at runtime called <code>walkFiles</code> and <code>walkPattern</code>, but these fail when used at compileTime!</p>
  <pre><code>import std/[os, sequtils, strformat, strutils]
  
  const resourceFolder = &quot;/home/philipp/dev/imagestable/html&quot; # Put into config file
  const applicationFiles = toSeq(walkFiles(fmt&quot;{resourceFolder}/*&quot;))
  </code></pre>
  <pre><code>/home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/os.nim(2121, 11) Error: cannot 'importc' variable at compile time; glob
  </code></pre>
  <p>How do I get around this?</p>