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

feat(runtime): support dynamic import() in runtime #819

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

maslow
Copy link
Member

@maslow maslow commented Feb 24, 2023

Since laf cloud function use commonjs module scheme, which cannot support es module imports.

You can now import es module by import() expression in cjs module:

export async function main(ctx) {
    const chatgpt =  await import('chatgpt')
    console.log(chatgpt)
}

BTW, laf cloud function will support es module natively in future.

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

Successfully merging this pull request may close these issues.

1 participant