Files
next.js/test/integration/build-trace-extra-entries-turbo/app/next.config.js
JJ KasperandGitHub 002fad3ccf Stabilize outputFileTracing configs (#68464)
These configs have been being validated for quite a while now and they
are pretty crucial to handle edge-cases without our output tracing setup
since we can't always trace 100% of cases. No functional changes are
made here expect removal of long deprecated
`experimental.outputFileTracingIgnores` and upgrading from experimental
for `outputFileTracingRoot`, `outputFileTracingIncludes`, and
`outputFileTracingExcludes`.

Closes: NDX-166
2024-08-03 11:21:59 +09:00

36 lines
884 B
JavaScript

const path = require('path')
module.exports = {
webpack(cfg, { isServer, nextRuntime }) {
console.log(cfg.entry)
const origEntry = cfg.entry
cfg.entry = async () => {
const origEntries = await origEntry()
if (isServer && nextRuntime === 'nodejs') {
const curEntry = origEntries['pages/_app']
origEntries['pages/_app'] = [
path.join(__dirname, 'lib/get-data.js'),
...curEntry,
]
console.log(origEntries)
}
return origEntries
}
return cfg
},
outputFileTracingIncludes: {
'/index': ['include-me/*'],
'/route1': ['include-me/*'],
},
outputFileTracingExcludes: {
'/index': ['public/exclude-me/**/*'],
'/route1': ['public/exclude-me/**/*'],
},
experimental: {
turbotrace: {
contextDirectory: path.join(__dirname, '..', '..', '..', '..'),
},
},
}