mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
deployment example (#126)
Co-authored-by: Aslam H <iupin5212@gmail.com>
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
|
||||
const isTauri = process.env.TAURI_ENV_DEBUG !== undefined
|
||||
const isProd = process.env.NODE_ENV === "production"
|
||||
const internalHost = process.env.TAURI_DEV_HOST || "localhost"
|
||||
const isIgnoreBuild = process.env.IGNORE_BUILD_ERRORS === "true"
|
||||
|
||||
console.log(isIgnoreBuild)
|
||||
const ignoreBuild = {
|
||||
typescript: {
|
||||
ignoreBuildErrors: true
|
||||
}
|
||||
}
|
||||
|
||||
const commonConfig = {
|
||||
reactStrictMode: false,
|
||||
images: {
|
||||
remotePatterns: [
|
||||
@@ -8,7 +21,27 @@ const nextConfig = {
|
||||
hostname: "**"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
...(isIgnoreBuild ? ignoreBuild : {})
|
||||
}
|
||||
|
||||
const tauriConfig = {
|
||||
...commonConfig,
|
||||
output: "export",
|
||||
images: {
|
||||
...commonConfig.images,
|
||||
unoptimized: true
|
||||
},
|
||||
assetPrefix: isProd ? null : `http://${internalHost}:3000`,
|
||||
...ignoreBuild
|
||||
}
|
||||
|
||||
const webConfig = {
|
||||
...commonConfig
|
||||
}
|
||||
|
||||
const nextConfig = isTauri ? tauriConfig : webConfig
|
||||
|
||||
console.log(`Using ${isTauri ? "Tauri" : "Web"} config`)
|
||||
|
||||
export default nextConfig
|
||||
|
||||
Reference in New Issue
Block a user