breautek commented on PR #109: URL: https://github.com/apache/cordova-plugin-screen-orientation/pull/109#issuecomment-1427941376
I'm going to close this as I couldn't actually produce a test case with webpack to trigger the error that the original PR attempted to resolve. Likely the `cordova-plugin-screen-orientation` package was being imported, or parsed by webpack which actually shouldn't happen to begin with. These packages should be treated as global/external packages and shouldn't be embedded with your webpack bundle. In simple webpack projects, importing cordova plugins isn't necessary as they will already be in your environment and you can reference these symbols without webpack complaining. In more advanced projects, where you may have different parsers involved, like typescript for example, an import may be necessary. In which case you can mark the cordova plugins as [external](https://webpack.js.org/configuration/externals/#externals) so only the dependency mapping is filled, but the actual code source will be provided elsewhere instead of it being bundled in the webpack bundle. Bundling cordova plugins may create hard-to-debug issues as you'll potentially have multiple versions of the same plugin API under different namespaces, potentially with different runtime states. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
