Fix build issues for meta imports and WSL filesystem
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user