Files
payloadcms/next.config.mjs
Alessio Gravili 7880fb402a chore: playwright support (#5262)
* working playwright

* chore: use zipped, local build of playwright instead of patching it

* chore: remove bloat

* chore: get playwright and lexical to work by fixing imports from cjs modules
2024-03-08 10:56:13 -05:00

31 lines
688 B
JavaScript

import bundleAnalyzer from '@next/bundle-analyzer'
import withPayload from './packages/next/src/withPayload.js'
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})
export default withBundleAnalyzer(
withPayload({
reactStrictMode: false,
async redirects() {
return [
{
destination: '/admin',
permanent: true,
source: '/',
},
]
},
webpack: (webpackConfig) => {
webpackConfig.resolve.extensionAlias = {
'.cjs': ['.cts', '.cjs'],
'.js': ['.ts', '.tsx', '.js', '.jsx'],
'.mjs': ['.mts', '.mjs'],
}
return webpackConfig
},
}),
)