We have Angular 4 project compiled aot and bundled with rollup and without lazy loading. It takes about 3 seconds for scripting during startup. I need to reduce this time. I found examples of Angular 4 app with startup time less then 1 sec: http://www.syntaxsuccess.com/bundling-demo-rollup#/demo/spreadsheet. So I believe it's possible to reduce our startup time. Below trace from our app.
Some function calls are suspicious: build, compileComponent and _compileTemplate. This is aot compilation and still building and compilation at startup. I didn't find any useful information about it. Any suggestion about how could it happened or why it's correct are welcome.
Any suggestions on how to improve startup loading time are welcome as well.
UPD
tsconfig-rollup.json
{
"extends": "./tsconfig.json",
"files": [
"temp/app/main.ts"
],
"angularCompilerOptions": {
"genDir": "temp/aot",
"skipMetadataEmit": true
}
}
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"module": "es2015",
"target": "es5",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"removeComments": true,
"declaration": false,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"es2015",
"es2017",
"dom"
]
},
"exclude": [
"node_modules"
]
}