sentry-javascript-bundler-plugins
sentry-javascript-bundler-plugins copied to clipboard
Specify moduleMetaData in webpack per entry point
- our use case is a legacy monorepo where every page is a micro front end
- However, all pages share a common webpack configuration---each page has its own entry page.
- as per https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/micro-frontend-support/#combining-modulemetadata-and-makemultiplexedtransport, we need to use the
sentryWebpackPlugin
to inject the project DSN via moduleMetaData. - But for our case, every entry point will have it's own DSN, so we need to be able to do something like this:
module.exports = {
plugins: [
sentryWebpackPlugin({
/* Other plugin config */
_experiments: {
moduleMetadata: ({ release, entry }) => ({ dsn: lookupDsnByEntry(entry), release })
},
}),
],
};
- alternatively, we just need a way to specify the DSN per page (bundle).