Files
next.js/test/integration/build-trace-extra-entries/app/next.config.js
Niklas MischkulnigandGitHub 40ad4fa548 Turbopack: fix route format for NFT globs (#82997)
These are effectively the tests for https://github.com/vercel/next.js/pull/82906

`outputFileTracingIncludes` and `outputFileTracingExcludes` match not against the pathname of the routes, but also include the app/pages prefix, e.g. `app/route1` for `src/app/route1/route.js` (at least the Webpack implementation does, which is what we're replicating here).
2025-08-26 09:23:12 +02:00

32 lines
876 B
JavaScript

const path = require('path')
module.exports = {
webpack(cfg, { isServer, nextRuntime }) {
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,
]
}
return origEntries
}
return cfg
},
outputFileTracingIncludes: {
// Full path includes "app" or "pages"
'/pages/index': ['include-me/**/*'],
'/app/route1': ['./include-me/**/*', 'node_modules/pkg-behind-symlink/*'],
'/*': ['include-me-global.txt'],
},
outputFileTracingExcludes: {
// Subpaths should also work
'/index': ['public/exclude-me/**/*'],
'/route1': ['./public/exclude-me/**/*'],
},
}