jan/web/next.config.js
2023-12-13 20:26:47 +07:00

44 lines
1.1 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
/** @type {import('next').NextConfig} */
const webpack = require('webpack')
const packageJson = require('./package.json')
const nextConfig = {
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({
PLUGIN_CATALOG: JSON.stringify(
'https://cdn.jsdelivr.net/npm/@janhq/plugin-catalog@latest/dist/index.js'
),
VERSION: JSON.stringify(packageJson.version),
ANALYTICS_ID:
process.env.ANALYTICS_ID ??
JSON.stringify('phc_cJ95zWbMwdef6nVasPCoSNOvV8lUcL5IykIYOoyGXVm'),
ANALYTICS_HOST:
process.env.ANALYTICS_HOST ??
JSON.stringify('https://app.posthog.com'),
}),
]
return config
},
}
module.exports = nextConfig