These are chat archives for systemjs/systemjs

22nd
Nov 2018
Scott
@ProtonScott
Nov 22 2018 00:56
@guybedford question, for what its worth, is it overly difficult to get systemjs working with web pack as well?
I have projects that use webpack, and all our (and unforunately not as common) greenfield work is using rollup + some other asset management tools (webpack is providing fewer advantages in some ways for us, and rollup is producing smaller builds)
our main draw to using systemjs regardless is that
what we want to acommplish is have SystemJS load our larger dependencies in the background (I use that word loosely) while a core <= 200kb script loads first
so it’d be like:
Scott
@ProtonScott
Nov 22 2018 01:08
well I don’t have a handy example at the moment
just this:
<script src=/public/js/init.js”></script>
<script src=“system.min.js” deferred> </script>
<script>
System.import(“fatfile.js")
</script>
or maybe we load it from a service worker
If its possible to have systemjs respond to that
Guy Bedford
@guybedford
Nov 22 2018 22:03
@ProtonScott the code splitting model is to have System.import('main.js') where that happens to have fatfile.js as a dependency.
For ways of creating that structure see the manualChunks option for Rollup
as for Webpack support, Webpack could certainly support System outputs and I did some experimentation on this previously, but never got much interest from Webpack for collaborating on this further
I'm sure there are a number of tricks that could be done though, although it would be hard work likely