These are chat archives for systemjs/systemjs

16th
Aug 2016
thuytn
@Sophia-nguyen
Aug 16 2016 08:17
anyone here?
Caige Nichols
@caiges
Aug 16 2016 21:59
I am
Miguel Couto
@Mig1st4ck
Aug 16 2016 22:58
hi guys
i am trying to setup systemjs
i have install systemjs with
npm install systemjs
then in index.html i added this code.
  <script src="/node_modules/systemjs/dist/system.js"></script>
<script>
  // set our baseURL reference path
  SystemJS.config({
      baseURL: '/',
      map: {
        'app': 'dist/ts'
      }
      packages: {
         'app': {
           main: 'index.js',
           format: 'cjs',
           defaultExtension: 'js',
         }
       }
    });

    // loads /dist/ts/main.js
    SystemJS.import('app/main');
  </script>
now the problem is that i use typescript to compile Typescript to commonjs
so my TS is
// main.ts
import {ABC} from './test';

console.log(ABC);

// test.ts
export const ABC = "ABC TEST OK";
my Js generated is
// main.js
"use strict";
var test_1 = require('./test');
console.log(test_1.ABC);
// test.js
"use strict";
exports.ABC = "ABC TEST OK";
Miguel Couto
@Mig1st4ck
Aug 16 2016 23:03
when i load the browser i get "main.ts:1 Uncaught ReferenceError: require is not defined"