These are chat archives for systemjs/systemjs

14th
Jul 2016
Patrick Surrey
@psurrey
Jul 14 2016 12:12
Hi all, when I require a module inside of a function, systemjs loads the module already when the file containing the function is loaded and not only when the function is executed... Is that intended behaviour?
Munawwar
@Munawwar
Jul 14 2016 12:31
@psurrey I think, that is the intended behavior.
If I am right, SystemJS checks for all require() calls after the JS is downloaded and loads them before executing the file.
Patrick Surrey
@psurrey
Jul 14 2016 12:49
@Munawwar Ok, I'm trying to load a huge dependency only if a certain function is executed, which only happens when the user enters a certain part in the application.. any Ideas how I would do this?
Munawwar
@Munawwar
Jul 14 2016 13:20
Not sure. Can anyone answer that? ^
Michael Bøcker-Larsen
@mblarsen
Jul 14 2016 13:20
You can use System.import in your code.
Patrick Surrey
@psurrey
Jul 14 2016 14:33
@mblarsen At the moment I only use system in my index.html. From there on its only with imports and requires. So I'm hesitating to use System within my application code...
Michael Bøcker-Larsen
@mblarsen
Jul 14 2016 14:40
Why is that. It is meant for it.