Skip to content

Commit

Permalink
ci: add webpack circular deps plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Jul 3, 2024
1 parent 98078b5 commit 49fcd8f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 43 deletions.
13 changes: 12 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check

const { BugsnagSourceMapUploaderPlugin } = require("webpack-bugsnag-plugins")
const CircularDependencyPlugin = require("circular-dependency-plugin")

/** @type {import("next").NextConfig} */
const nextConfig = {
Expand All @@ -21,8 +22,8 @@ const nextConfig = {
],
})

if (!config.plugins) config.plugins = []
if (process.env.VERCEL_ENV === "production") {
if (!config.plugins) config.plugins = []
config.plugins.push(
new BugsnagSourceMapUploaderPlugin({
apiKey: process.env.NEXT_PUBLIC_BUGSNAG_KEY ?? "",
Expand All @@ -32,6 +33,16 @@ const nextConfig = {
)
}

config.plugins.push(
new CircularDependencyPlugin({
exclude: /.next|node_modules/,
include: /src/,
// TODO: if all circular dependencies are resolved, set this argument to true
failOnError: false,
allowAsyncCycles: false,
})
)

return config
},
productionBrowserSourceMaps: true,
Expand Down
55 changes: 13 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@zag-js/combobox": "^0.16.0",
"@zag-js/react": "^0.16.0",
"chakra-react-select": "^4.7.6",
"circular-dependency-plugin": "^5.2.2",
"color": "^4.2.3",
"colorthief": "^2.3.2",
"events": "^3.3.0",
Expand Down

0 comments on commit 49fcd8f

Please sign in to comment.