Slow build times when compiling a React Portlet
Written By
Daniel Carrillo Broeder
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- After setting up some libraries in package.json, like mui, the build time is longer than expected.
Environment
- DXP 7.0, 7.1, 7.2, 7.3
- DXP 7.4, Quarterly Releases
Resolution
- In most cases, this happens due to file processing performed by liferay-npm-bundler.
- While this behavior is expected, there are some available options to consider:
- Exclude files to reduce the number of processed files.
- This is a manual action and can be complex to perform.
- The reduction could be noticeable but limited.
- Use webpack or other build tools that unify into a single JS file.
- Replace the custom portlet with Client Extensions.
- This is the recommended approach, but it is only available for DXP 7.4 and Quarterly Releases.
Did this article resolve your issue ?