mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
- https://github.com/vercel/next.js/pull/82857 provides a better way to do this that we intend to document. - This syntax was never documented (outside of the types and tests). You wouldn't be able to figure out the built-in conditions without digging through the Turbopack source code.
41 lines
937 B
JavaScript
41 lines
937 B
JavaScript
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
const nextConfig = {
|
|
turbopack: {
|
|
rules: {
|
|
'*.test-file.js': [
|
|
{
|
|
condition: { all: ['browser', 'foreign'] },
|
|
loaders: [
|
|
{
|
|
loader: require.resolve('./test-file-loader.js'),
|
|
options: { browser: true, foreign: true },
|
|
},
|
|
],
|
|
},
|
|
{
|
|
condition: { all: ['browser', { not: 'foreign' }] },
|
|
loaders: [
|
|
{
|
|
loader: require.resolve('./test-file-loader.js'),
|
|
options: { browser: true },
|
|
},
|
|
],
|
|
},
|
|
{
|
|
condition: { not: { any: ['browser', 'foreign'] } },
|
|
loaders: [
|
|
{
|
|
loader: require.resolve('./test-file-loader.js'),
|
|
options: { default: true },
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
}
|
|
|
|
module.exports = nextConfig
|