These are chat archives for systemjs/systemjs

23rd
May 2016
Eric Hiller
@erichiller
May 23 2016 00:52
how can I load node_modules and their dependencies easily? Or is the only way to map out every single dependency?
Peter Müller
@Munter
May 23 2016 08:47
Install your npm dependencies using jspm, then it configures things correctly for you
miha-
@miha-
May 23 2016 19:01
hi. could some help me with this:
node bundle.js Unhandled rejection Error on translate for ts/app.js at file:///Users/mzoubek/Documents/Miha/www/GroupSweat/public/ts/app.js MultipleErrors: file:///Users/mzoubek/Documents/Miha/www/GroupSweat/public/ts/app.js:4:1: Unexpected token @ file:///Users/mzoubek/Documents/Miha/www/GroupSweat/public/ts/app.js:4:2: Semi-colon expected
tnx
Trey Long
@xealot
May 23 2016 19:04
seems like bad JS with an "Unexpected Token" error.
miha-
@miha-
May 23 2016 19:05
@xealot
var SystemBuilder = require('systemjs-builder');
var argv = require('yargs').argv;
var builder = new SystemBuilder();

builder.loadConfig('./system.config.js')
  .then(function(){
      var outputFile = argv.prod ? 'dist/bundle.min.js' : 'dist/bundle.js';
      return builder.buildStatic('app', outputFile, {
          minify: argv.prod,
          mangle: argv.prod,
          rollup: argv.prod
      });
  })
  .then(function(){
      console.log('bundle built successfully!');
  });
@xealot i just fallowed tutiral
Trey Long
@xealot
May 23 2016 19:07
Look at /Users/mzoubek/Documents/Miha/www/GroupSweat/public/ts/app.js line 4
are you using angular2? because @ on line one is probably the start of a decorator... maybe your JS isn't compiled?
Either way, this doesn't seem like a systemjs issue.
miha-
@miha-
May 23 2016 19:09
@xealot yes, using angular2
i did tsc before running angular and works ok without any error
Trey Long
@xealot
May 23 2016 19:09
what does app.ts look like?
miha-
@miha-
May 23 2016 19:09
here is my system.config.js code
```
//configure system loader
System.config({
map: {
'rxjs': 'node_modules/rxjs',
'@angular': 'node_modules/@angular',
'app': 'ts'
},
packages: {
'app': {
main: 'app.js',
defaultExtension: 'js'
},
'@angular/core': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/compiler': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/common': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser-dynamic': {
main: 'index.js',
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
}
}
})

//configure system loader
System.config({
map: {
'rxjs': 'node_modules/rxjs',
'@angular': 'node_modules/@angular',
'app': 'ts'
},
packages: {
'app': {
main: 'app.js',
defaultExtension: 'js'
},
'@angular/core': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/compiler': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/common': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser-dynamic': {
main: 'index.js',
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
}
}
})
sorry...
import { bootstrap } from "@angular/platform-browser-dynamic";
import { Component } from "@angular/core";

@Component({
    selector: 'gs-test',
    template: `sss`
})


class groupSweatBoot {
    constructor() {

    }
}

bootstrap(groupSweatBoot);
app.ts
Trey Long
@xealot
May 23 2016 19:14
I don't see anything immediately off hand, maybe have more luck in the angular room.
miha-
@miha-
May 23 2016 19:15
@xealot tnx :) will try there
Trey Long
@xealot
May 23 2016 19:32
I am trying to load an Angular2 bundle. This thing has hundreds of System.register("..." calls in it. Yet, the browser seems to try to download every file individually anyway as if the bundle didn't register the entire framework already.
What is a way I can try to debug this behavior?
If I look at System.defined I seem to have two versions of most things... a node_modules version and a non.
Daniel Meza
@danielmeza
May 23 2016 19:47
Hi guys! I have an Aurelia project and of course I'm using System.js for load my modules, but when I use Edge the load goes too slow, this happen because the Promise its slow on Edge, to fix that I use the Promise es6 which work well with Edge but with my implementation have some problems, it not print the errors en the console, do you know some tutorial o way to change correctly the promise module?