Skip to content
Discussion options

You must be logged in to vote

Hello 👋 @Gapuccino,
You’re right that combinations/default.js is usually what Lighthouse flags for “Reduce unused JavaScript”, and engine/react.js is part of the Arc runtime, so you have limited control over that one.

Let me go through your questions briefly:

1. Code splitting in custom blocks

Yes, it’s safe and recommended to use code splitting, but the preferred way in Arc is to use the engine’s built-in lazy loading rather than custom Webpack tweaks.

For any heavy feature/block, you can mark it as lazy so it’s built as a separate chunk and only loaded when needed, for example:

const Feature = () => {
  return <HeavyThing />;
};

Feature.lazy = ['default']; // or true for all outputs

e…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Gapuccino
Comment options

Answer selected by Gapuccino
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
2 participants