Angular 2/4 official starter build AOT deployment keynote.
After AOT compiling and Rollup bundling, my app size decreases from 3 MB to around 250 KB landing / 600~ KB total. Load-time improves noticeably.
I followed this guide and encountered some minor problems. Here’s some additional keynote:
- Make sure you update your project and global dependencies, if codes in a common library report error during compiling time, probably your TypeScript is too old.
- All config files in that guide have this file structure “src/app/***”, change it accounting to yours. Mine is “app/***”.
- If you’re using SystemJS in dev( way faster re-compiling ), and “moduleId: module.id” for templates relative URL. Put
in the very top of your index.html to avoid moduleId undefine error.
- In my rollup-config.js, I commented out:
It keeps giving me trouble. Also, I changed the “plugins > commonjs > include” to include all of node_modules sub-folders for my other dependencies:
Otherwise Rollup gets these errors: ” Error: ‘***’ is not exported by node_modules\*** “.