Switch config file require to dynamic import#2047
Switch config file require to dynamic import#2047Brad-Turner wants to merge 7 commits intocontentful:mainfrom
Conversation
|
Hey @elylucas , any chance you can have a look over this PR please 🙏🏼 |
|
Hey @Brad-Turner. Thank you so much for the PR. We're taking a look at this right now. To help us with the code review could you give us some more information about the context driving these changes?
|
|
Hey @Niko-Berry-Contentful , Sorry for the delayed response. Busy time planning my wedding 😅
import contentfulExport from 'contentful-export';
await contentfulExport({ /* settings, etc */ }); At my work, we often script exports, transforms and uploads and this is kind of annoying when I have to switch between runtimes to export from/import to contentful. |
|
Hey @Brad-Turner, thank you for this PR. You are right, in a pure ESM environment we won't have require available. I have a few issue with your changes:
Thank you so far, Note to myself: We need to mirror this change to contentful-import as well |
This PR aims to improve ESM compatibility by removing the
requirecall to load an external config file.