Fix build issues for meta imports and WSL filesystem

This commit is contained in:
Timo Knuth
2026-04-23 11:50:09 +02:00
parent 6e68408391
commit c7d5f281c5
5 changed files with 287 additions and 151 deletions

View File

@@ -1,8 +1,18 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
skipTrailingSlashRedirect: true,
images: {
import os from 'os';
import path from 'path';
function isWslOnWindowsMount() {
return process.platform === 'linux' && process.cwd().startsWith('/mnt/');
}
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
skipTrailingSlashRedirect: true,
eslint: {
ignoreDuringBuilds: true,
},
images: {
unoptimized: false,
remotePatterns: [
{ protocol: 'https', hostname: 'www.qrmaster.net' },
@@ -19,13 +29,23 @@ const nextConfig = {
// Allow build to succeed even with prerender errors
// Pages with useSearchParams() will be rendered dynamically at runtime
staticPageGenerationTimeout: 120,
onDemandEntries: {
maxInactiveAge: 25 * 1000,
pagesBufferLength: 2,
},
poweredByHeader: false,
async redirects() {
return [
onDemandEntries: {
maxInactiveAge: 25 * 1000,
pagesBufferLength: 2,
},
poweredByHeader: false,
webpack: (config, { dev }) => {
if (!dev && isWslOnWindowsMount()) {
config.cache = {
type: 'filesystem',
cacheDirectory: path.join(os.tmpdir(), 'qrmaster-next-webpack-cache'),
};
}
return config;
},
async redirects() {
return [
{
source: '/create-qr',
destination: '/dynamic-qr-code-generator',