From 6ce020f6a13d7cc1b53281026c2b97b0113b474a Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 4 Feb 2024 12:54:23 -0500 Subject: [PATCH 1/3] configure svelte to be no-ssr --- Taskfile.yaml | 3 +++ package.json | 1 + src/routes/+layout.js | 1 + svelte.config.js | 10 ++++++---- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 src/routes/+layout.js diff --git a/Taskfile.yaml b/Taskfile.yaml index e126acd..a2f2171 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -6,6 +6,9 @@ vars: GREETING: Hello, World! tasks: + build: + cmds: + - vite build update-game: cmds: - node src/scripts/updateUsers.js diff --git a/package.json b/package.json index 50b83f3..7077450 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "type": "module", "dependencies": { "@sveltejs/adapter-node": "^4.0.1", + "@sveltejs/adapter-static": "^3.0.1", "@vincjo/datatables": "^1.14.4", "beercss": "^3.4.13", "better-sqlite3": "^9.3.0", diff --git a/src/routes/+layout.js b/src/routes/+layout.js new file mode 100644 index 0000000..189f71e --- /dev/null +++ b/src/routes/+layout.js @@ -0,0 +1 @@ +export const prerender = true; diff --git a/svelte.config.js b/svelte.config.js index 6bfb3c4..3887b06 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,10 +1,12 @@ -import adapter from '@sveltejs/adapter-node'; +import adapter from '@sveltejs/adapter-static'; /** @type {import('@sveltejs/kit').Config} */ const config = { - kit: { - adapter: adapter() - } + kit: { + adapter: adapter({ + fallback: '/index.html', + }), + }, }; export default config; From f928cd26b15bba9a62c9cf4768bf6a6112857fd0 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 4 Feb 2024 13:02:59 -0500 Subject: [PATCH 2/3] add deploy task --- Taskfile.yaml | 5 +++++ contrib/nginx-bggsell.conf | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 contrib/nginx-bggsell.conf diff --git a/Taskfile.yaml b/Taskfile.yaml index a2f2171..bafdfb2 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -6,6 +6,11 @@ vars: GREETING: Hello, World! tasks: + deploy: + deps: [build] + cmds: + - rsync -av build/ bggsell@gilgamesh:public_html + build: cmds: - vite build diff --git a/contrib/nginx-bggsell.conf b/contrib/nginx-bggsell.conf new file mode 100644 index 0000000..eabd1fe --- /dev/null +++ b/contrib/nginx-bggsell.conf @@ -0,0 +1,20 @@ +server { + listen 443; + listen [::]:443; + + ssl_certificate /etc/lego/certificates/_.babyl.ca.crt; + ssl_certificate_key /etc/lego/certificates/_.babyl.ca.key; + + server_name bgg.babyl.ca; + + access_log /var/log/nginx/bgg.log; + error_log /var/log/nginx/bgg-error.log; + + client_max_body_size 10M; + + root /home/bggsell/public_html; + index index.html; + location / { + try_files $uri $uri/ $uri.html /index.html =404; + } +} From 034eb7710f2d1c7185b69c0878a66a0ec9652bb9 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 4 Feb 2024 13:06:33 -0500 Subject: [PATCH 3/3] docs(changeset): feat: make the app browser-only (no ssr) --- .changeset/little-meals-move.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/little-meals-move.md diff --git a/.changeset/little-meals-move.md b/.changeset/little-meals-move.md new file mode 100644 index 0000000..d3bdf7e --- /dev/null +++ b/.changeset/little-meals-move.md @@ -0,0 +1,5 @@ +--- +"ottawa-boardgame-sell-bgg": minor +--- + +feat: make the app browser-only (no ssr)