title: How do I use TypeScript compiler in the browser?
body: <p>I'm trying to use the TypeScript compiler in the browser (e.g. Chrome):</p>
  
  <pre><code>import * as ts from "typescript";
  
  [...]
  
  const host = ts.createCompilerHost(options);
  
  [...]
  </code></pre>
  
  <p>The above code fails because createCompilerHost references ts.sys internally, which is undefined.</p>
  
  <p>How do I ensure ts.sys exists? Can I emulate it myself? assigning ts.sys (ts.sys = ...) fails because it is readonly.</p>