loadable-components icon indicating copy to clipboard operation
loadable-components copied to clipboard

Support the chunkName method

Open yanghuabei opened this issue 1 year ago • 0 comments

🚀 Feature Proposal

Add chunkName method to loadable component.

Motivation

Our page uses server-side rendering, and some loadable features need to be displayed immediately after the page loads. We hope to obtain the chunkName during server-side rendering and then preload resources.

Example


// server side
import { LoadablePopup } from './loadable'

const chunkName = LoadablePopup.chunkName();
const resources = collectResources(chunkName);
// Then insert link preload after body tag

Pitch

Why does this feature belong in the Loadable Component ecosystem?

yanghuabei avatar Jul 09 '24 07:07 yanghuabei