Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy load modules #5

Open
AAChartModel opened this issue Nov 12, 2020 · 1 comment
Open

Lazy load modules #5

AAChartModel opened this issue Nov 12, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@AAChartModel
Copy link
Owner

AAChartModel commented Nov 12, 2020

https://github.com/highcharts/highcharts#load-highcharts-from-the-cdn-as-ecmascript-modules

@AAChartModel AAChartModel added the enhancement New feature or request label Nov 12, 2020
@AAChartModel
Copy link
Owner Author

Just like this:

const loadHighchartsAndCreateChart = async () => {
    const { default: Highcharts } =
        await import('https://code.highcharts.com/es-modules/masters/highcharts.src.js');
    await import('https://code.highcharts.com/es-modules/masters/highcharts-more.src.js');
    await import('https://code.highcharts.com/es-modules/masters/modules/exporting.src.js');
    await import('https://code.highcharts.com/es-modules/masters/modules/export-data.src.js');

    Highcharts.chart('container', { /* options */ });
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant