We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reduce bundle size in angular

Thread ID:

Created:

Updated:

Platform:

Replies:

149402 Nov 25,2019 11:21 AM UTC Dec 11,2019 01:08 PM UTC Angular - EJ 2 5
loading
Tags: Schedule
Hasan Rifaii
Asked On November 25, 2019 11:21 AM UTC

Hello,
How it could be possible to reduce bundle size in angular? 



Vinitha Devi Murugan [Syncfusion]
Replied On November 26, 2019 06:49 AM UTC

Hi Hasan 
  
Syncfusion Greetings.  
  
Could you please share the below or more detail that will be helpful for us to validate further at our end and provide a better solution as soon as possible.   
 
  • Did you faced the problem only in development or both development & production
  • Did you inject ScheduleAllModule or ScheduleModule in app.module.ts
  • Did you used webpack or angular cli application?
  • If possible share the sample or share the full code example and package version details.
Regards,  
M.Vinitha devi     
 


Hasan Rifaii
Replied On November 26, 2019 08:07 AM UTC

Hello,

Did you faced the problem only in development or both development & production
     I have uploaded images below to compare the difference in bundle size between prod and non prod build. Nevertheless, prod bundle still large as I mentioned before

Did you inject ScheduleAllModule or ScheduleModule in app.module.ts
     Always using ScheduleModule

Did you used webpack or angular cli application?
     Angular Cli v8.3.8

If possible share the sample or share the full code example and package version details.
     Referred to the attachment below

Thank you


Attachment: reporting_c4ae3ac1.rar

Vinitha Devi Murugan [Syncfusion]
Replied On November 27, 2019 09:15 AM UTC

Hi Hasan, 
 
Thanks for sharing the details. 
 
By default, while in production mode it optimize(compress & minify) and remove the unused, duplicate codes & modules from bundle file so that it contains less bundle size when compared to development mode because in development mode it set build Optimizer and Optimization as false(so it does not optimize the code). 
 
 
Regards, 
M.Vinitha devi 


Hasan Rifaii
Replied On December 6, 2019 09:17 AM UTC

Hello, 
The --prod meta flag is already specified. I wondering if it's still possible to decrease the bundle less than 4mb ?

Thank you,

Vinitha Devi Murugan [Syncfusion]
Replied On December 11, 2019 01:08 PM UTC

Hi Hasan, 
 
Yes, you can reduce the bundle size less then 3MB by setting target in “tsconfig.json” to be “es5”. Please refer below sample and screenshot. 
 
 
 
 
Tsconfig.json 
"target": "es5", 
 
Regards, 
M.Vinitha devi 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon