Update next export

This commit is contained in:
DefectingCat
2022-08-31 14:27:59 +08:00
parent 2b9db34c1b
commit 5dbe5c6cac
4 changed files with 27 additions and 5 deletions

View File

@ -4,6 +4,8 @@ import { GistsFile } from 'types';
const password = process.env.NEXT_PUBLIC_GITHUB_API;
const octokit = new Octokit({
auth: password,
// @TODO reverse proxy
baseUrl: 'http://api.github.com',
});
const linkMatch = /<(.*?)>/;

View File

@ -14,6 +14,7 @@
// images: { domains: ['avatars.githubusercontent.com'] },
// },
// ]);
/**
* @type {import('next').NextConfig}
*/
@ -24,8 +25,18 @@ const nextConfig = {
experimental: {
// runtime: 'nodejs',
// outputStandalone: true,
images: { allowFutureImage: true },
images:
process.env.NEXT_BUILD === 'export'
? { allowFutureImage: true, unoptimized: true }
: { allowFutureImage: true },
},
// images:
// process.env.NEXT_BUILD === 'export'
// ? {
// loader: 'imgix',
// path: 'https://rua.plus/',
// }
// : {},
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
};

View File

@ -4,8 +4,9 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && node scripts/build-search.mjs",
"build:export": "next build && next export && node scripts/build-search.mjs",
"build": "next build && yarn build:search",
"build:export": "cross-env NEXT_BUILD=export next build && cross-env NEXT_BUILD=export next export",
"build:search": "node scripts/build-search.mjs",
"start": "next start",
"lint": "next lint",
"test": "jest --watch",
@ -40,6 +41,7 @@
"@types/node": "18.7.13",
"@types/react": "18.0.17",
"autoprefixer": "^10.4.8",
"cross-env": "^7.0.3",
"dotenv": "^16.0.1",
"eslint": "8.22.0",
"eslint-config-next": "12.2.5",

View File

@ -3063,6 +3063,13 @@ crelt@^1.0.5:
resolved "https://registry.npmmirror.com/crelt/-/crelt-1.0.5.tgz#57c0d52af8c859e354bace1883eb2e1eb182bb94"
integrity sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==
cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"
cross-spawn@^5.0.1:
version "5.1.0"
resolved "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
@ -3072,7 +3079,7 @@ cross-spawn@^5.0.1:
shebang-command "^1.2.0"
which "^1.2.9"
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==