title: How do you import a text file into typescript?
body: <p>As a minimal example, I want to import a text file into typescript and print it to the console without reading it using <code>fs</code>. Something like this:</p>
  
  <pre><code>import text from './foo.txt'
  
  console.log(text)
  </code></pre>
  
  <p>I've found many examples of solutions, such as <a href="https://stackoverflow.com/a/47705264/311156">this one</a> and I have created a <code>typings.d.ts</code> file with the content</p>
  
  <pre><code>declare module '*.txt' {
    const content: string;
    export default content;
  }
  </code></pre>
  
  <p>But when I build the project I still see "error TS2307: Cannot find module './foo.txt'."</p>
  
  <p>What am I missing?</p>
  
  <p>Example repo here: <a href="https://github.com/gferreri/typescript-import-test" rel="noreferrer">https://github.com/gferreri/typescript-import-test</a></p>