Skip to content

Support the chunkName method #1010

Open
@yanghuabei

Description

@yanghuabei

🚀 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions