These are chat archives for systemjs/systemjs

30th
Aug 2016
C. Daniel
@cdaniel77
Aug 30 2016 15:36
Hi all, I am using JSPM/SystemJS with aurelia and I notice that my system.js files take 4 seconds to load. Is this a known issue? Is there a fix for that?
Gregg Roemhildt
@roemhildtg
Aug 30 2016 19:23
Hi, I'm trying to write a plugin that async loads a module and registers it directly with SystemJS using System.register. It doesn't work though because systemjs scans the file and notices that there is a "System.register" in the file that isn't called. Well, it is called but not until the file is loaded. Here's the gist of it: https://gist.github.com/roemhildtg/4dce79f9bffe74b99a6a6cea3f44604f
Jeff
@Jefftopia
Aug 30 2016 19:25

@cdaniel77 You should look into the System JS builder. It can bundle, minify, mangle, and tree-shake your sources. Moreover, you can generate a self-executing bundle.

A nice guide can be found here. It's for Angular 2, but similar principles apply.

@mzedeler Yeah, that's why people frequently use System JS with JSPM. when you install from JSPM, it will automatically write the map with the file locations.

The downside is that literally every dependency is added to the map; it could easily > 2000-3000 lines. Moreover, since JSPM conventions break with NPM, it adds files to a bizarre JSPM directory. That was an issue for me when I developed in TypeScript, since it does node module lookups...in the node_modules folder, which JSPM just didn't use.

Anyways, good luck.