title: Typescript. ReferenceError: require is not defined
body: <p>I read official <a href="https://www.typescriptlang.org/docs/handbook/modules.html" rel="noreferrer">doc</a> for TypeScript, and I copy code from there.</p>
  
  <p>I  install commonjs and requerejs.</p>
  
  <pre><code>"devDependencies": {
    ...
    "commonjs": "latest",
    "requirejs": "latest"
  }
  </code></pre>
  
  <p>But I get a error in the browser:</p>
  
  <pre><code>ReferenceError: require is not defined
  </code></pre>
  
  <p>It is index.html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;body&gt;
       &lt;script src="main.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>It is main.js after compiling:</p>
  
  <pre><code>"use strict";
  var core_1 = require("./some_dir/some_file");
  window.onload = function () {
      var some = new some_file_1.SomeClass();
  };
  </code></pre>