These are chat archives for systemjs/systemjs

21st
Jun 2016
nickolasacosta
@nickolasacosta
Jun 21 2016 00:39
sorry I was out
glad to see you got it working
nickolasacosta
@nickolasacosta
Jun 21 2016 00:54
@rubenvereecken I'm curious as to how you got rid of the "require is not a function" error. If you remember.
Hendrik Roth
@HendrikRoth
Jun 21 2016 10:09
is there a way to have two systemjs instances? i would like to load an extern systemjs application, but at the moment it uses the wrong systemjs config
frangkyundap
@frangkyundap
Jun 21 2016 12:45
ok
nickolasacosta
@nickolasacosta
Jun 21 2016 13:08
ok
Stephen Cavaliere
@delasteve
Jun 21 2016 14:41

Given:

const map: any = {
  'jQuery': 'vendor/jquery/dist',
  'tether': 'vendor/tether/dist/js',
  'twbs': 'vendor/bootstrap/dist/js'
};

const packages: any = {
  'jQuery': {
    main: 'jquery.min',
    format: 'global',
    defaultExtension: 'js'
   },
  'tether': {
    main: 'tether.min',
    format: 'global',
    defaultExtension: 'js'
   },
  'twbs': {
    main: 'bootstrap.min',
    format: 'global',
    defaultExtension: 'js'
   }
};

const meta: any = {
  'twbs': {
    deps: ['tether', 'jQuery']
  }
};

Doesn’t SystemJS automatically load tether and jQuery when I say import ‘twbs’;? I swore this was working previously.

I’m currently getting:

Unhandled Promise rejection: (SystemJS) Error: Bootstrap's JavaScript requires jQuery
Stephen Cavaliere
@delasteve
Jun 21 2016 15:06
Huh, turns out that the meta needs to reference the full mapped path of twbs (or vendor/bootstrap/dist/js/bootstrap.min.js)
nickolasacosta
@nickolasacosta
Jun 21 2016 18:38
can you post your fixed version?
nickolasacosta
@nickolasacosta
Jun 21 2016 18:53
@delasteve
Stephen Cavaliere
@delasteve
Jun 21 2016 19:02
The only thing that changed was
const meta: any = {
  'vendor/bootstrap/dist/js/bootstrap.min.js': {
    deps: ['tether', 'jQuery']
  }
};
@NickolasAcosta ^
nickolasacosta
@nickolasacosta
Jun 21 2016 19:26
thanks
Stephen Cavaliere
@delasteve
Jun 21 2016 19:48
np