Skip to content

Commit

Permalink
bug: merge existing and blitz turbo config (#4323)
Browse files Browse the repository at this point in the history
* do not oveeride existing config

* Create calm-deers-sin.md

* Update packages/blitz-next/src/index-server.ts
  • Loading branch information
siddhsuresh authored Apr 17, 2024
1 parent 7755546 commit 5e61a16
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/calm-deers-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@blitzjs/next": patch
"blitz": patch
---

bug: merge existing and custom blitz turbo configs
18 changes: 16 additions & 2 deletions packages/blitz-next/src/index-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,22 @@ export function withBlitz(nextConfig: BlitzConfig = {}): NextConfig {
})

if (process.env.TURBOPACK) {
;(config as any).experimental = {
turbo: installTurboConfig(),
const blitzTurboConfig = installTurboConfig()
config.experimental = {
...config.experimental,
turbo: {
loaders: {
...config.experimental?.turbo?.loaders,
},
resolveAlias: {
...config.experimental?.turbo?.resolveAlias,
...blitzTurboConfig.resolveAlias,
},
rules: {
...config.experimental?.turbo?.rules,
...blitzTurboConfig.rules,
},
},
}
}

Expand Down

0 comments on commit 5e61a16

Please sign in to comment.