mirror of
https://github.com/dsec-hub/dsec-notebook.git
synced 2026-09-22 15:43:58 +00:00
75 lines
1.9 KiB
TypeScript
75 lines
1.9 KiB
TypeScript
import tailwindcss from "@tailwindcss/vite";
|
|
import { defineConfig } from "vitest/config";
|
|
import { playwright } from "@vitest/browser-playwright";
|
|
import adapter from "@sveltejs/adapter-node";
|
|
import { sveltekit } from "@sveltejs/kit/vite";
|
|
import { SvelteKitPWA } from "@vite-pwa/sveltekit";
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
tailwindcss(),
|
|
sveltekit({
|
|
compilerOptions: {
|
|
// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
|
|
runes: ({ filename }) =>
|
|
filename.split(/[/\\]/).includes("node_modules") ? undefined : true,
|
|
},
|
|
|
|
// adapter-node is used because the app persists data to a local SQLite file on the server.
|
|
adapter: adapter(),
|
|
}),
|
|
SvelteKitPWA({
|
|
registerType: "autoUpdate",
|
|
devOptions: {
|
|
enabled: true,
|
|
type: "module",
|
|
},
|
|
manifest: {
|
|
name: "DSEC Notebook",
|
|
short_name: "Notebook",
|
|
description:
|
|
"A resource hub for Deakin University students: shared study notes, questions and answers for SIT and Mathematics units.",
|
|
start_url: "/",
|
|
scope: "/",
|
|
display: "standalone",
|
|
background_color: "#ffffff",
|
|
theme_color: "#ffffff",
|
|
lang: "en",
|
|
},
|
|
pwaAssets: {
|
|
image: "static/dsec-logo-2.webp",
|
|
preset: "minimal-2023",
|
|
includeHtmlHeadLinks: false,
|
|
injectThemeColor: false,
|
|
},
|
|
}),
|
|
],
|
|
test: {
|
|
expect: { requireAssertions: true },
|
|
projects: [
|
|
{
|
|
extends: "./vite.config.ts",
|
|
test: {
|
|
name: "client",
|
|
browser: {
|
|
enabled: true,
|
|
provider: playwright(),
|
|
instances: [{ browser: "chromium", headless: true }],
|
|
},
|
|
include: ["src/**/*.svelte.{test,spec}.{js,ts}"],
|
|
exclude: ["src/lib/server/**"],
|
|
},
|
|
},
|
|
|
|
{
|
|
extends: "./vite.config.ts",
|
|
test: {
|
|
name: "server",
|
|
environment: "node",
|
|
include: ["src/**/*.{test,spec}.{js,ts}"],
|
|
exclude: ["src/**/*.svelte.{test,spec}.{js,ts}"],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|