I am working on building a chatbot using angular 5. I have created a small application with 8/9 components. Now the problem is production build (bundle js ) files total comes up to 3.6 MB. If I have to host these files on cdn it would cost a LOT.
How do I reduce the bundle size to something feasible like 100 kb ?
Bundle details:
ng build
hunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 3.89 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 107 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 202 kB [initial] [rendered]
chunk {scripts} scripts.bundle.js, scripts.bundle.js.map (scripts) 204 kB [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 216 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.12 MB [initial] [rendered]
ng build --prod
chunk {inline} inline.a07175516c55c4014717.bundle.js (inline) 3.85 kB [entry] [rendered]
chunk {main} main.2e592d7ffe3a062bbdc0.bundle.js (main) 183 kB [initial] [rendered]
chunk {polyfills} polyfills.a958547e95fad8a7be8a.bundle.js (polyfills) 202 kB [initial] [rendered]
chunk {scripts} scripts.d93272ec54002ead254c.bundle.js (scripts) 204 kB [initial] [rendered]
chunk {styles} styles.b54edcd81812769932a0.bundle.css (styles) 197 kB [initial] [rendered]
chunk {vendor} vendor.343d293a3f72c924cb46.bundle.js (vendor) 2.84 MB [initial] [rendered]