From 1c990fe73859cacd9cbcf491b22450f6a00b61f0 Mon Sep 17 00:00:00 2001 From: Quentin Bramas <bramas@unistra.fr> Date: Mon, 11 Nov 2024 11:33:54 +0100 Subject: [PATCH] static generation --- .gitlab-ci.yml | 4 ++-- app.config.ts | 11 ++++++++++- package.json | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54ecba7..fd5e729 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ stages: variables: # Répertoire où le site sera généré - PUBLIC_DIR: dist + PUBLIC_DIR: .output/public before_script: # Installer les dépendances @@ -21,7 +21,7 @@ build: stage: build script: # Construire le site avec Vite (le bundler par défaut pour SolidJS) - - yarn build + - yarn build-static artifacts: paths: - $PUBLIC_DIR diff --git a/app.config.ts b/app.config.ts index de7f831..ef2ee8a 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,3 +1,12 @@ import { defineConfig } from "@solidjs/start/config"; -export default defineConfig({}); +export default defineConfig({ + ssr: true, + server: { + + prerender: { + crawlLinks: true + }, + preset: 'static' + } + }); \ No newline at end of file diff --git a/package.json b/package.json index e8d2491..06a6a1d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "dev": "vinxi dev", "build": "vinxi build", "start": "vinxi start", - "version": "vinxi version" + "version": "vinxi version", + "build-static": "vinxi build --preset static" }, "dependencies": { "@solidjs/meta": "^0.29.4", -- GitLab