From 575fa84fa469c5c2373474a3d193661702bd7677 Mon Sep 17 00:00:00 2001 From: Vitaliy Shevchenko Date: Mon, 1 Jul 2024 12:44:05 +0700 Subject: [PATCH] deploy fix --- .nojekyll | 0 next.config.mjs | 20 ++++++++++++++++++-- tsconfig.json | 27 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .nojekyll create mode 100644 tsconfig.json diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/next.config.mjs b/next.config.mjs index 4678774..6104006 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,20 @@ +const isGithubActions = process.env.GITHUB_ACTIONS || false; + +let assetPrefix = ""; +let basePath = ""; + +if (isGithubActions) { + const repo = process.env.GITHUB_REPOSITORY.replace(/.*?\//, ""); + + assetPrefix = `/${repo}/`; + basePath = `/${repo}`; +} + /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + assetPrefix, + basePath, + output: "export", // Ensure this line is present +}; -export default nextConfig; +module.exports = nextConfig; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e59724b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] +}