title: Can't run a basic Typescript script through a .net core web app
body: <p>Project struct</p>
  
  <pre><code>Proj
  --wwwroot/scripts
  --scripts
  --tsconfig.json
  ----Account
  ------app.ts
  --gulpfile.js
  </code></pre>
  
  <p>Given the following TypeScript in scripts/Account/app.ts:</p>
  
  <pre><code>function sayHello() {
      alert('hello world');
  }
  </code></pre>
  
  <p>a tsconfig.json file of </p>
  
  <pre><code>{
   "compilerOptions": {
      "noImplicitAny": true,
      "noEmitOnError": true,
      "sourceMap": true,
      "target": "es6", 
      "lib": [ "es6", "dom" ] 
    },
    "compileOnSave": false
  }
  </code></pre>
  
  <p>and a gulpfile.js of </p>
  
  <pre><code>var gulp = require('gulp');
  var browserify = require('browserify');
  var source = require('vinyl-source-stream');
  var tsify = require('tsify');
  
  gulp.task('default', function () {
      return browserify({
          basedir: '.',                               
          entries: ['scripts/Account/app.ts'],        
          cache: {},                                  
          packageCache: {}                           
          })
          .plugin(tsify)                              
          .bundle()                                   
          .pipe(source('scripts/Account/app.js'))             
          .pipe(gulp.dest("wwwroot/scripts"));        
  });
  </code></pre>
  
  <p>I get an outputted file in wwwroot/scripts/app.js.  But the function can't be called from the web pages that use it because it isn't available globally as it appears to be wrapped in a function:</p>
  
  <p><a href="https://i.stack.imgur.com/3UNcO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3UNcO.png" alt="Screenshot"></a></p>
  
  <p>So what am I missing in my compilation steps to be able to call a basic typescript function?  I've tried exporting the function, in which case it just adds it to the exports object:</p>
  
  <p><a href="https://i.stack.imgur.com/4Bcs4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Bcs4.png" alt="Screenshot 2"></a></p>