Skip to content

Commit

Permalink
chore(explorer): seperate dev build artifacts per target config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Feb 24, 2025
1 parent 7420055 commit 199cfe3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ deploy.log

# Next.js
.next
.next-*

# builds
dist
Expand Down
16 changes: 11 additions & 5 deletions apps/explorer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const { composePlugins, withNx } = require('@nx/next');
const { composePlugins, withNx } = require('@nx/next')

const runningTargetConfiguration = process.env.NX_TASK_TARGET_CONFIGURATION

/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
Expand All @@ -12,10 +14,14 @@ const nextConfig = {
svgr: false,
},
output: 'standalone',
// Since explorer is built for multiple networks, we need to use the target
// name to ensure the next build directory is unique to avoid conflicts when
// switching between networks during development.
distDir: runningTargetConfiguration.includes('development')
? `.next-${runningTargetConfiguration}`
: '.next',
}

const plugins = [
withNx,
];
const plugins = [withNx]

module.exports = composePlugins(...plugins)(nextConfig);
module.exports = composePlugins(...plugins)(nextConfig)
13 changes: 4 additions & 9 deletions apps/explorer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"types": [
"jest",
"node"
],
"types": ["jest", "node"],
"plugins": [
{
"name": "next"
Expand All @@ -29,10 +26,8 @@
"**/*.jsx",
"next-env.d.ts",
".next/types/**/*.ts",
"../../dist/apps/explorer/.next/types/**/*.ts"
".next-development/types/**/*.ts",
".next-development-testnet-zen/types/**/*.ts"
],
"exclude": [
"node_modules",
"jest.config.ts"
]
"exclude": ["node_modules", "jest.config.ts"]
}

0 comments on commit 199cfe3

Please sign in to comment.