49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
// Only use export mode for production builds
|
|
...(process.env.NODE_ENV === 'production' && {
|
|
output: 'export',
|
|
trailingSlash: true,
|
|
skipTrailingSlashRedirect: true,
|
|
distDir: 'out',
|
|
}),
|
|
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
|
|
images: {
|
|
unoptimized: true
|
|
},
|
|
assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH || '',
|
|
// Development optimizations
|
|
experimental: {
|
|
turbo: {
|
|
rules: {
|
|
'*.svg': {
|
|
loaders: ['@svgr/webpack'],
|
|
as: '*.js',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
webpack(config, options) {
|
|
// Add url-loader for video files
|
|
config.module.rules.push({
|
|
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)$/,
|
|
use: [
|
|
{
|
|
loader: 'url-loader',
|
|
options: {
|
|
limit: 8192,
|
|
fallback: 'file-loader',
|
|
publicPath: '/_next/static/media/',
|
|
outputPath: 'static/media/',
|
|
esModule: false,
|
|
},
|
|
},
|
|
],
|
|
});
|
|
|
|
return config;
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|