perf!: hosting on firebase as static files

BREAKING CHANGE: not-found page is now Next.js default
This commit is contained in:
rusconn
2023-06-17 14:42:07 +09:00
parent 4d198c5b96
commit b9bedd13ef
7 changed files with 48 additions and 2 deletions

View File

@@ -3,3 +3,4 @@ dist/*
public public
node_modules node_modules
*.esm.js *.esm.js
out

4
.gitignore vendored
View File

@@ -36,3 +36,7 @@ tsconfig.tsbuildinfo
# eslint # eslint
.eslintcache .eslintcache
# firebase
.firebase
firebase-debug.log

View File

@@ -9,3 +9,4 @@ node_modules
build build
.contentlayer .contentlayer
pnpm-lock.yaml pnpm-lock.yaml
out

View File

@@ -8,6 +8,7 @@ To reproduce environment, use [VOLTA](https://volta.sh/)
## Known issues ## Known issues
- [App directory root not-found.tsx not compiled to 404.html when using static export](https://github.com/vercel/next.js/issues/48227)
- Tool search does not set query parameters - Tool search does not set query parameters
- [(Shallow routing) updating search params causes server code to rerun.](https://github.com/vercel/next.js/issues/49668) - [(Shallow routing) updating search params causes server code to rerun.](https://github.com/vercel/next.js/issues/49668)
- [Editor may not resize to fit container size](https://github.com/suren-atoyan/monaco-react/issues/346) - [Editor may not resize to fit container size](https://github.com/suren-atoyan/monaco-react/issues/346)

37
firebase.json Normal file
View File

@@ -0,0 +1,37 @@
{
"hosting": {
"public": "out",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"headers": [
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=0, must-revalidate"
}
]
},
{
"source": "favicon.ico",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=3600, must-revalidate"
}
]
},
{
"source": "_next/static/**",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
],
"cleanUrls": true,
"trailingSlash": false
}
}

View File

@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
output: "export",
reactStrictMode: true, reactStrictMode: true,
experimental: { experimental: {
typedRoutes: true, typedRoutes: true,

View File

@@ -9,12 +9,13 @@
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"analyze": "ANALYZE=true next build", "analyze": "ANALYZE=true next build",
"start": "next start", "start": "npx serve@latest out",
"deploy": "firebase deploy --project devtoysweb",
"check": "pnpm typecheck && pnpm lint && pnpm format:check", "check": "pnpm typecheck && pnpm lint && pnpm format:check",
"fix": "pnpm lint:fix && pnpm format:write", "fix": "pnpm lint:fix && pnpm format:write",
"lint": "next lint", "lint": "next lint",
"lint:fix": "next lint --fix", "lint:fix": "next lint --fix",
"preview": "next build && next start", "preview": "next build && npx serve@latest out",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"format:write": "pnpm format --write", "format:write": "pnpm format --write",
"format:check": "pnpm format --check", "format:check": "pnpm format --check",