Skip to content

Commit

Permalink
feat: collaborate with Spectrum
Browse files Browse the repository at this point in the history
  • Loading branch information
aiji42 committed Aug 18, 2021
1 parent a4103eb commit 425e064
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/with-split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ type WithSplitArgs = {
}

export const withSplit =
({ splits = {}, ...manuals }: WithSplitArgs) =>
({ splits: _splits = {}, ...manuals }: WithSplitArgs) =>
(nextConfig: Partial<NextConfig>): Partial<NextConfig> => {
if (process.env.SPLIT_DISABLE) return nextConfig

// Load the configuration using Spectrum.
const splits: SplitOptions =
Object.keys(_splits).length > 0
? _splits
: JSON.parse(process.env.SPLIT_CONFIG_BY_SPECTRUM ?? '{}')

const isMain =
!!process.env.SPLIT_ACTIVE ||
(manuals?.isOriginal ?? process.env.VERCEL_ENV === 'production')
Expand Down

0 comments on commit 425e064

Please sign in to comment.