Skip to content

Commit

Permalink
Remove cache clearing from static-checker (#8290)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored and Timer committed Aug 9, 2019
1 parent 08b14e4 commit 1db6918
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/next/build/static-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ export default function worker(
try {
const { serverBundle, runtimeEnvConfig } = options || ({} as any)
const result = isPageStatic(serverBundle, runtimeEnvConfig)

// clear require.cache to prevent running out of memory
// since the cache is persisted by default
Object.keys(require.cache).map(modId => {
const mod = require.cache[modId]
delete require.cache[modId]
if (mod.parent) {
const idx = mod.parent.children.indexOf(mod)
mod.parent.children.splice(idx, 1)
}
})

callback(null, result)
} catch (error) {
callback(error)
Expand Down

0 comments on commit 1db6918

Please sign in to comment.