Skip to content

Commit 9823923

Browse files
committed
Add excludes to nft ignore
1 parent 5cfee37 commit 9823923

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

packages/next/build/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { getRouteMatcher, getRouteRegex } from '../shared/lib/router/utils'
2323
import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'
2424
import escapePathDelimiters from '../shared/lib/router/utils/escape-path-delimiters'
2525
import { findPageFile } from '../server/lib/find-page-file'
26-
import { GetStaticPaths } from 'next/types'
26+
import { GetStaticPaths, PageConfig } from 'next/types'
2727
import { denormalizePagePath } from '../server/normalize-page-path'
2828
import { BuildManifest } from '../server/get-page-files'
2929
import { removePathTrailingSlash } from '../client/normalize-trailing-slash'
@@ -927,7 +927,7 @@ export async function isPageStatic(
927927
}
928928

929929
const isNextImageImported = (global as any).__NEXT_IMAGE_IMPORTED
930-
const config = mod.config || {}
930+
const config: PageConfig = mod.config || {}
931931
return {
932932
isStatic: !hasStaticProps && !hasGetInitialProps && !hasServerProps,
933933
isHybridAmp: config.amp === 'hybrid',

packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@ function getModuleFromDependency(
2727
export class TraceEntryPointsPlugin implements webpack.Plugin {
2828
private appDir: string
2929
private entryTraces: Map<string, string[]>
30+
private excludeFiles: string[]
3031

31-
constructor({ appDir }: { appDir: string }) {
32+
constructor({
33+
appDir,
34+
excludeFiles,
35+
}: {
36+
appDir: string
37+
excludeFiles?: string[]
38+
}) {
3239
this.appDir = appDir
3340
this.entryTraces = new Map()
41+
this.excludeFiles = excludeFiles || []
3442
}
3543

3644
// Here we output all traced assets and webpack chunks to a
@@ -223,7 +231,7 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
223231
readFile,
224232
readlink,
225233
stat,
226-
ignore: TRACE_IGNORES,
234+
ignore: [...TRACE_IGNORES, ...this.excludeFiles],
227235
})
228236

229237
const tracedDeps: string[] = []

packages/next/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ export type PageConfig = {
8080
env?: Array<string>
8181
unstable_runtimeJS?: false
8282
unstable_JsPreload?: false
83-
unstable_includeFiles?: false
84-
unstable_excludeFiles?: false
83+
unstable_includeFiles?: string[]
84+
unstable_excludeFiles?: string[]
8585
}
8686

8787
export {

0 commit comments

Comments
 (0)