Fix Webpack compatibility - #99
Conversation
🦋 Changeset detectedLatest commit: 2d8d537 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
387852a to
6e7da23
Compare
|
When importing through |
That's a pre-existing bug in the React Native app's webpack config, which this PR only exposes. Its It went unnoticed until now because webpack used to resolve the UMD bundle, whose The fix is to leave module syntax to webpack: presets: [['module:@react-native/babel-preset', { disableImportExportTransform: true }]],PR for the e2e app: THEOplayer/react-native-connectors#465. That also lets us remove the filename-specific |
6e7da23 to
a958a43
Compare
a958a43 to
2d8d537
Compare
Webpack seems to always select the UMD version using a
requirecondition, whereas the ESM version is much more suitable for such bundlers.I also revisited the fix from #95 to be more robust. We will now specifically look for the
Conviva.ConstantsAPI to decide whether to use thedefaultor namespace import when loading the Conviva SDK. This should be more robust.