Skip to content

Commit b470818

Browse files
add bundle analyzer, bump course-search-utils
1 parent 1ac605a commit b470818

File tree

3 files changed

+150
-27
lines changed

3 files changed

+150
-27
lines changed

frontends/main/next.config.js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,29 +103,38 @@ const nextConfig = {
103103
// Injected content via Sentry wizard below
104104

105105
const { withSentryConfig } = require("@sentry/nextjs")
106+
const withSentry = (config) =>
107+
withSentryConfig(config, {
108+
// For all available options, see:
109+
// https://github.com/getsentry/sentry-webpack-plugin#options
106110

107-
module.exports = withSentryConfig(nextConfig, {
108-
// For all available options, see:
109-
// https://github.com/getsentry/sentry-webpack-plugin#options
111+
org: "mit-office-of-digital-learning",
112+
project: "open-next",
110113

111-
org: "mit-office-of-digital-learning",
112-
project: "open-next",
114+
// Only print logs for uploading source maps in CI
115+
silent: !process.env.CI,
113116

114-
// Only print logs for uploading source maps in CI
115-
silent: !process.env.CI,
117+
// For all available options, see:
118+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
116119

117-
// For all available options, see:
118-
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
120+
// Upload a larger set of source maps for prettier stack traces (increases build time)
121+
widenClientFileUpload: true,
119122

120-
// Upload a larger set of source maps for prettier stack traces (increases build time)
121-
widenClientFileUpload: true,
123+
// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
124+
// This can increase your server load as well as your hosting bill.
125+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
126+
// side errors will fail.
127+
// tunnelRoute: "/monitoring",
122128

123-
// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
124-
// This can increase your server load as well as your hosting bill.
125-
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
126-
// side errors will fail.
127-
// tunnelRoute: "/monitoring",
129+
// Automatically tree-shake Sentry logger statements to reduce bundle size
130+
disableLogger: true,
131+
})
128132

129-
// Automatically tree-shake Sentry logger statements to reduce bundle size
130-
disableLogger: true,
133+
const withBundleAnalyzer = require("@next/bundle-analyzer")({
134+
enabled: process.env.ANALYZE === "true",
131135
})
136+
137+
module.exports = [withBundleAnalyzer, withSentry].reduce(
138+
(acc, withPlugin) => withPlugin(acc),
139+
nextConfig,
140+
)

frontends/main/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"dependencies": {
1313
"@ebay/nice-modal-react": "^1.2.13",
1414
"@emotion/cache": "^11.13.1",
15-
"@mitodl/course-search-utils": "3.2.4",
15+
"@mitodl/course-search-utils": "https://github.com/mitodl/course-search-utils.git#ad876deb31e1259d603baec10dcc035cd0d82910",
16+
"@next/bundle-analyzer": "^14.2.15",
1617
"@remixicon/react": "^4.2.0",
1718
"@sentry/nextjs": "^8",
1819
"@tanstack/react-query": "^4.36.1",

yarn.lock

Lines changed: 121 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)