I’ve written an Aurelia app for a portable device (watch). It works very well. One issue I have is Aurelia boot time so I’m trying to determine if there’s anything I can do to make this faster. my app seems to take almost 10 seconds from launch to loaded. My main.configure looks something like this:
export function configure(aurelia: Aurelia) {
aurelia.use.preTask(() => {
console.time(‘app-use’)
})
.defaultBindingLanguage()
.defaultResources()
.eventAggregator()
.globalResources(
[
PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
, PLATFORM.moduleName("./Blah")
])
.plugin(‘aurelia-i18n’, (instance: I18N) => { //Blah })
.postTask(() => {
console.timeEnd(‘app-use’)
});
It seems the issue is with the slow script loading time. Example is one bundle is taking 5s, while the other is taking 6s. I think to debug this issue, you will need a several invesgiration rounds.
I’m guessing you are not splitting the code at all, as there’ only 3 bundles. Even though everything is only in local file server, not everything should be loaded when the app start, maybe there’s big amount of code that can be separated and lazy loaded. This is where the 2nd parameter in your PLATFORM.moduleName could be useful: it signals webpack what bundle a module should go into.
Maybe try with these 2 steps first, and let’s see what low hanging fruits we can target first?