2
0
Files
bot/apps/landing-page/next.config.js

57 lines
1.4 KiB
JavaScript
Raw Normal View History

// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
2022-04-10 17:39:39 -05:00
const pages = ['pricing', 'privacy-policies', 'terms-of-service', 'about']
module.exports = withBundleAnalyzer({
async redirects() {
return [
{
source: '/typebot-lib',
destination:
'https://unpkg.com/typebot-js@2.0.21/dist/index.umd.min.js',
permanent: true,
},
{
source: '/typebot-lib/v2',
2022-03-04 17:00:30 +01:00
destination: 'https://unpkg.com/typebot-js@2.1.3/dist/index.umd.min.js',
permanent: true,
},
]
},
async rewrites() {
return {
beforeFiles: [
{
source: '/_next/static/:static*',
destination:
process.env.NEXT_PUBLIC_VIEWER_URL + '/_next/static/:static*',
has: [
{
type: 'header',
key: 'referer',
value:
process.env.LANDING_PAGE_HOST +
'/(?!' +
pages.join('|') +
'|\\?).+',
},
],
},
],
fallback: [
{
2022-02-10 17:13:57 +01:00
source: '/:typebotId*',
destination: process.env.NEXT_PUBLIC_VIEWER_URL + '/:typebotId*',
2022-02-10 17:13:57 +01:00
},
{
source: '/api/:path*',
destination: process.env.NEXT_PUBLIC_VIEWER_URL + '/api/:path*',
},
],
}
},
})