Skip to content

Commit

Permalink
Merge pull request #26904 from element-hq/t3chguy/add-webpack-sentry-…
Browse files Browse the repository at this point in the history
…workaround

Add workaround for webpack builds on platforms unsupported by Sentry
  • Loading branch information
t3chguy authored Jan 22, 2024
2 parents 19ed4a8 + 0aed37a commit db78839
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const HtmlWebpackInjectPreload = require("@principalstudio/html-webpack-inject-preload");
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");

// Environment variables
Expand Down Expand Up @@ -701,9 +700,11 @@ module.exports = (env, argv) => {
files: [{ match: /.*Inter.*\.woff2$/ }],
}),

// upload to sentry if sentry env is present
// Upload to sentry if sentry env is present
// This plugin throws an error on import on some platforms like ppc64le & s390x even if the plugin isn't called,
// so we require it conditionally.
process.env.SENTRY_DSN &&
sentryWebpackPlugin({
require("@sentry/webpack-plugin").sentryWebpackPlugin({
release: process.env.VERSION,
sourcemaps: {
paths: "./webapp/bundles/**",
Expand Down

0 comments on commit db78839

Please sign in to comment.