title: Require... now exports is undefined, What am I missing here?
body: <p>Really like TypeScript, followed this supposed easy <a href="https://www.c-sharpcorner.com/article/quick-start-up-with-typescript/" rel="nofollow noreferrer">sample</a>, the last part "<strong>Export and Import concept</strong>", bang! First got "JavaScript runtime error: require is undefined". Google found I need to install RequirJS, make sense, installed, bypassed it. Now, the same undefined message for '<strong>exports</strong>'.</p>
  
  <p>This is what I've gone through:</p>
  
  <ol>
  <li><p>I went through all 3 related post in SO,
  <a href="https://stackoverflow.com/questions/36985591/typescript-modules-in-visual-studio-2015-update-2-require-is-undefined">TypeScript Modules in Visual Studio 2015 Update 2 - &#39;require&#39; is undefined</a></p>
  
  <p><a href="https://stackoverflow.com/questions/41103968/how-to-fix-0x800a1391-javascript-runtime-error-require-is-undefined">How to fix &#39;0x800a1391 - JavaScript runtime error: &#39;require&#39; is undefined&#39;?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/43042889/typescript-referenceerror-exports-is-not-defined">Typescript ReferenceError: exports is not defined</a></p>
  
  <p>Still not resolving.</p></li>
  <li><p>Adding a TSConfig.json like <a href="https://www.typescriptlang.org/docs/handbook/asp-net-core.html" rel="nofollow noreferrer">this</a>, same.</p></li>
  <li><p>Downloaded the supposed-ok source code, hah, his ended with <code>'System' is undefined</code>. Did npm install SystemJS, got "... open 'C:...\package.json', ... no descripton, no repository, ..., no license." Okay, added an empty package.json, same result.</p></li>
  </ol>
  
  <p>So my questions are:</p>
  
  <ul>
  <li>What am I missing here for my own project?</li>
  <li>Are TSConfig.json and package.json required for TypeScript?</li>
  </ul>
  
  <p>My project, <strong>tsconfig.json</strong>:</p>
  
  <pre><code>{
    "compilerOptions": {
      "noImplicitAny": true,
      "noEmitOnError": true,
      "removeComments": false,
      "sourceMap": true,
      "target": "es5"
    },
    "exclude": [
      "node_modules",
      "wwwroot"
    ],
    "compileOnSave": true
  }
  </code></pre>
  
  <p><strong>Customer.js</strong></p>
  
  <pre><code>import { Address } from "./Address";
  
  class Customer
  {
      private _customerName: string = "";
      private _addressObj: Address = new Address();
  
      public set CustomerNameBase(value: string){
          this._customerName = value;
      }
      public get CustomerNameBase(){
          return this._customerName;
      }
  
      Validate()
      {
          this._addressObj.PlotNumber = 12;
          alert(this._addressObj.PlotNumber);
      }
  }
  
  class CustomerModified extends Customer
  {
      Validate()
      {
          throw "throw from CustomerModified";
      }
  }
  </code></pre>
  
  <p><strong>Address.ts:</strong></p>
  
  <pre><code>export class Address
  {
      public PlotNumber: number;
  }
  </code></pre>
  
  <p><strong>Customer.html:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script src="./Address.js"&gt;&lt;/script&gt;
      &lt;script src="Scripts/require.js"&gt;&lt;/script&gt;
      &lt;script src="./customer.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          var customer = new CustomerModified();
          try
          {
              customer.Validate();
          }
          catch (exception)
          {
              alert("exception raised: " + exception);
          }
          finally
          {
              alert("finally.");
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>VS 2017 Professional v15.1 (26403.3) 
  <a href="https://i.stack.imgur.com/ls9RP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ls9RP.jpg" alt="enter image description here"></a></p>