Optimize produced bundles for Anonymous users
See original GitHub issueThere are some opportunities to further shrink the generated bundle with the techniques described here: https://webpack.js.org/guides/lazy-loading/
We’ve been using this technique for a custom implementation that uses ckeditor:
componentDidMount() {
import(/* webpackChunkName: 'ckeditor' */ '@ckeditor/ckeditor5-react').then(
module => this.setState({ CKEditor: module.default }),
);
import(
/* webpackChunkName: 'classiCk' */ '@ckeditor/ckeditor5-build-classic'
).then(module => this.setState({ ClassicEditor: module.default }));
}
And then in component rendering we use this.state.ClassicEditor
and such to render the CKEditor component. This causes Webpack to split those resources in a separate chunk that’s loaded on demand when the parent components is first mounted.
As the bigger candidates in Volto’s case, I see the draftjs editor (which will also include immutable.js) and the DND support, I think it’s react-dnd.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
How to Optimize Returns for Product Bundles - Narvar
Product bundles made up of variations on a single item can be a great way for shoppers to try new styles, flavors, or...
Read more >Analyze your React app's bundle size and reduce it using ...
An app's bundle size is the amount of JavaScript a user will have to download to load your app. The bigger the bundle...
Read more >Reactjs Build Production: Optimize Performance - CopyCat Blog
In this article, we will be taking a deep dive into the Reactjs build production, deployment, and tips on optimising your app's performance....
Read more >How We Reduced Startup Time by 80% With Webpack
Enter webpack · 1. Install required dependencies · 2. Create and export your config file · 3. Add config to instruct webpack where...
Read more >How can I configure Webpack for better optimization? Error ...
How can I configure Webpack for better optimization? Error: Conflict: Multiple chunks emit assets to the same filename main.js.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tiberiuichim the chunks are loaded on-demand with
loadable-components
. It is based on the same dynamic imports you suggested above.After #1365