* cache full rendering * still not working with gzip * progress progress progress * smaller * hacky progress * small fixes * wip * lock file * wip * wip * package-lock updates * wip * search DOM in lowercase * simplify * with instrument * improve test coverage * mutateCheeriobodyByRequest * fix * remove renderContentCacheByContex * disable render caching in sync-search * diables things in github/github link checker * gzip lru * tidying up * updated * correct tests * fix: move userLanguage to LanguagesContext * Revert "fix: move userLanguage to LanguagesContext" This reverts commit d7c05d958c71eaad496eb46764eb845d80b866ca. * contexts ftw * fixed rendering tests * oops for got new file * nits addressed Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
// import { productIds } from './lib/all-products.js'
|
|
// import languages from './lib/languages.js'
|
|
|
|
const fs = require('fs')
|
|
const frontmatter = require('gray-matter')
|
|
const path = require('path')
|
|
const homepage = path.posix.join(process.cwd(), 'content/index.md')
|
|
const { data } = frontmatter(fs.readFileSync(homepage, 'utf8'))
|
|
const productIds = data.children
|
|
|
|
module.exports = {
|
|
// speed up production `next build` by ignoring typechecking during that step of build.
|
|
// type-checking still occurs in the Dockerfile build
|
|
typescript: {
|
|
ignoreBuildErrors: true,
|
|
},
|
|
eslint: {
|
|
ignoreDuringBuilds: true,
|
|
},
|
|
i18n: {
|
|
// locales: Object.values(languages).map(({ code }) => code),
|
|
locales: ['en', 'cn', 'ja', 'es', 'pt'],
|
|
defaultLocale: 'en',
|
|
},
|
|
sassOptions: {
|
|
quietDeps: true,
|
|
},
|
|
async rewrites() {
|
|
const DEFAULT_VERSION = 'free-pro-team@latest'
|
|
return productIds.map((productId) => {
|
|
return {
|
|
source: `/${productId}/:path*`,
|
|
destination: `/${DEFAULT_VERSION}/${productId}/:path*`,
|
|
}
|
|
})
|
|
},
|
|
webpack: (config) => {
|
|
config.experiments = config.experiments || {}
|
|
config.experiments.topLevelAwait = true
|
|
return config
|
|
},
|
|
|
|
// https://nextjs.org/docs/api-reference/next.config.js/compression
|
|
compress: false,
|
|
}
|