Some checks failed
Release / Test backend (push) Successful in 18s
CI / Test backend (pull_request) Successful in 17s
Release / Docker / caddy (push) Successful in 42s
Release / Check ui (push) Successful in 45s
CI / Check ui (pull_request) Successful in 24s
CI / Docker / caddy (pull_request) Failing after 38s
Release / Docker / runner (push) Successful in 2m16s
Release / Docker / backend (push) Successful in 2m33s
CI / Docker / backend (pull_request) Successful in 2m14s
Release / Upload source maps (push) Successful in 30s
CI / Docker / runner (pull_request) Successful in 1m26s
CI / Docker / ui (pull_request) Successful in 1m14s
Release / Docker / ui (push) Successful in 2m6s
Release / Gitea Release (push) Failing after 2s
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import { defineConfig } from 'vite';
|
|
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
|
|
|
// Source maps are always generated so that the CI pipeline can upload them to
|
|
// GlitchTip after a release build. The sentryVitePlugin upload step is only
|
|
// active when SENTRY_AUTH_TOKEN is present (i.e. in the release CI job).
|
|
export default defineConfig({
|
|
build: {
|
|
sourcemap: true
|
|
},
|
|
plugins: [
|
|
tailwindcss(),
|
|
sveltekit(),
|
|
sentryVitePlugin({
|
|
org: 'libnovel',
|
|
project: 'libnovel-ui',
|
|
url: 'https://errors.libnovel.cc/',
|
|
// Auth token injected by CI via SENTRY_AUTH_TOKEN env var.
|
|
// When the env var is absent the plugin is a no-op.
|
|
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
// Release name matches the Docker image tag (e.g. "1.2.3").
|
|
release: { name: process.env.BUILD_VERSION },
|
|
// Don't upload source maps in local dev or CI type-check jobs.
|
|
disable: !process.env.SENTRY_AUTH_TOKEN,
|
|
// Source maps are uploaded to GlitchTip; do not ship them in the
|
|
// production bundle served to browsers.
|
|
sourcemaps: {
|
|
filesToDeleteAfterUpload: ['./build/**/*.map']
|
|
}
|
|
})
|
|
],
|
|
ssr: {
|
|
// Force these packages to be bundled into the server output rather than
|
|
// treated as external requires. The production Docker image has no
|
|
// node_modules, so anything used in server-side code must be inlined.
|
|
noExternal: ['marked'],
|
|
// cropperjs is DOM-only (used inside $effect); exclude from SSR bundle.
|
|
external: ['cropperjs']
|
|
},
|
|
optimizeDeps: {
|
|
include: ['cropperjs']
|
|
}
|
|
});
|