Hello i am new to front end next js deplyoment
currently, i have created one next js application with version 14.1.4
and to build deployment i am using this command
npm run build
but it is giving below error
The "next export" command has been removed in favor of "output: export" in next.config.js. Learn more: https://nextjs.org/docs/advanced-features/static-html-export
below is my next.config.js file can someone please help me to resolve this issue
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [{
source: "/(t|T)(e|E)(x|X)(t|T)",
destination: "/text"
}]
},
images: {
domains: [
'naturalproduct.s3.amazonaws.com',
'naturalproductproduction.s3.amazonaws.com',
'naturalproductstaging.s3.amazonaws.com',
'naturalproducttest.s3.amazonaws.com',
'cdn-icons-png.flaticon.com',
'static.vecteezy.com']
},
experimental: {
missingSuspenseWithCSRBailout: false,
},
env: getEnvConfig()
}
module.exports = nextConfig
function getEnvConfig() {
const dotenv = require('dotenv');
const environment = process.env.TARGET_ENV || process.env.NODE_ENV;
const envFilePath = `.env.${environment}`;
try {
const result = dotenv.config({ path: envFilePath });
if (result.error) {
throw result.error;
}
return result.parsed;
} catch (err) {
console.error(`Error loading environment variables from ${envFilePath}: ${err.message}`);
return {};
}
}