Skip to content

Commit

Permalink
fix splitChunks
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Mar 12, 2024
1 parent b356dc2 commit 7355a2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ export default async function getBaseWebpackConfig(
// Ensures the framework chunk is not created for App Router.
layer: isWebpackDefaultLayer,
test(module: any) {
if (module.type.startsWith('css')) return false
if (module.type?.startsWith('css')) return false
const resource = module.nameForCondition?.()
return resource
? topLevelFrameworkPaths.some((pkgPath) =>
Expand All @@ -1015,7 +1015,7 @@ export default async function getBaseWebpackConfig(
nameForCondition: Function
}): boolean {
return (
!module.type.startsWith('css') &&
!module.type?.startsWith('css') &&
module.size() > 160000 &&
/node_modules[/\\]/.test(module.nameForCondition() || '')
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class CssChunkingPlugin {
}
once = true
const chunkGraph = compilation.chunkGraph
let changed = false
let changed: undefined | true = undefined

const chunkStates = new Map<Chunk, ChunkState>()
const chunkStatesByModule = new Map<Module, Map<ChunkState, number>>()
Expand Down

0 comments on commit 7355a2f

Please sign in to comment.