jan/web/next.config.js
hiento09 2cbbe1bcd3
Fix bug #2005 docker blank website (#2093)
* Web: change API_BASE_URL to build time env

* Update Dockerfile and Docker Compose by adding env API_BASE_URL

* Update make clean

* INFERENCE_URL get from baseApiUrl

* Fix error settings/settings.json not found when start server at the first time

* Update README docker

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
2024-02-19 23:30:59 +07:00

48 lines
1.2 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
/** @type {import('next').NextConfig} */
const webpack = require('webpack')
const packageJson = require('./package.json')
const nextConfig = {
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
output: 'export',
assetPrefix: '.',
images: {
unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
},
webpack: (config) => {
// do some stuff here
config.optimization.minimize = false
config.optimization.minimizer = []
config.plugins = [
...config.plugins,
new webpack.DefinePlugin({
VERSION: JSON.stringify(packageJson.version),
ANALYTICS_ID: JSON.stringify(process.env.ANALYTICS_ID),
ANALYTICS_HOST: JSON.stringify(process.env.ANALYTICS_HOST),
API_BASE_URL: JSON.stringify(
process.env.API_BASE_URL ?? 'http://localhost:1337'
),
isMac: process.platform === 'darwin',
isWindows: process.platform === 'win32',
isLinux: process.platform === 'linux',
}),
]
return config
},
}
module.exports = nextConfig