Created
April 24, 2023 20:20
-
-
Save wichopy/95fad00444be9d2de9d3acd95ffde0ed to your computer and use it in GitHub Desktop.
Configure webpack in microfrontends to work with cors and error monitoring libraries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error monitoring needs your javascript bundles to allow CORS with the Access-Control-Allow-Origin header and to set the annonymous value on the crossorigin attribute in the script tag. | |
See rollbar docs: | |
https://rollbar.com/knowledge-base/unknownscript-error/ | |
To configure this in webpack, simply update the output property: | |
https://webpack.js.org/configuration/output/#outputcrossoriginloading | |
output: { | |
// ...path and stuff, | |
crossOriginLoading: 'anonymous' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment