Skip to content

Commit

Permalink
Add excludes to nft ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Aug 16, 2021
1 parent 5cfee37 commit 9823923
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/next/build/utils.ts
Expand Up @@ -23,7 +23,7 @@ import { getRouteMatcher, getRouteRegex } from '../shared/lib/router/utils'
import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'
import escapePathDelimiters from '../shared/lib/router/utils/escape-path-delimiters'
import { findPageFile } from '../server/lib/find-page-file'
import { GetStaticPaths } from 'next/types'
import { GetStaticPaths, PageConfig } from 'next/types'
import { denormalizePagePath } from '../server/normalize-page-path'
import { BuildManifest } from '../server/get-page-files'
import { removePathTrailingSlash } from '../client/normalize-trailing-slash'
Expand Down Expand Up @@ -927,7 +927,7 @@ export async function isPageStatic(
}

const isNextImageImported = (global as any).__NEXT_IMAGE_IMPORTED
const config = mod.config || {}
const config: PageConfig = mod.config || {}
return {
isStatic: !hasStaticProps && !hasGetInitialProps && !hasServerProps,
isHybridAmp: config.amp === 'hybrid',
Expand Down
Expand Up @@ -27,10 +27,18 @@ function getModuleFromDependency(
export class TraceEntryPointsPlugin implements webpack.Plugin {
private appDir: string
private entryTraces: Map<string, string[]>
private excludeFiles: string[]

constructor({ appDir }: { appDir: string }) {
constructor({
appDir,
excludeFiles,
}: {
appDir: string
excludeFiles?: string[]
}) {
this.appDir = appDir
this.entryTraces = new Map()
this.excludeFiles = excludeFiles || []
}

// Here we output all traced assets and webpack chunks to a
Expand Down Expand Up @@ -223,7 +231,7 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
readFile,
readlink,
stat,
ignore: TRACE_IGNORES,
ignore: [...TRACE_IGNORES, ...this.excludeFiles],
})

const tracedDeps: string[] = []
Expand Down
4 changes: 2 additions & 2 deletions packages/next/types/index.d.ts
Expand Up @@ -80,8 +80,8 @@ export type PageConfig = {
env?: Array<string>
unstable_runtimeJS?: false
unstable_JsPreload?: false
unstable_includeFiles?: false
unstable_excludeFiles?: false
unstable_includeFiles?: string[]
unstable_excludeFiles?: string[]
}

export {
Expand Down

0 comments on commit 9823923

Please sign in to comment.