Files
continuwuity/packages/website/svelte.config.js
T

47 lines
1.6 KiB
JavaScript
Raw Normal View History

import "dotenv/config";
2024-05-01 18:34:30 +01:00
import { mdsvex } from "mdsvex";
import mdsvexConfig from "./mdsvex.config.js";
import adapter from "@sveltejs/adapter-node";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
// import htmlMinifierAdaptor from "sveltekit-html-minifier";
2024-04-02 16:18:53 +01:00
2024-05-01 18:34:30 +01:00
import cspDirectives from "./csp.js";
2024-02-13 16:38:14 +00:00
/** @type {import('@sveltejs/kit').Config} */
2024-04-02 16:18:53 +01:00
2024-02-13 16:38:14 +00:00
const config = {
2024-07-15 13:58:21 +01:00
extensions: ['.svelte', '.md', '.svelte.md'],
2024-05-01 18:34:30 +01:00
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: [mdsvex(mdsvexConfig), vitePreprocess()],
2024-02-13 16:38:14 +00:00
2024-05-01 18:34:30 +01:00
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter:
// Disabled html min as it runs after precompress
// htmlMinifierAdaptor(
adapter(),
// {
// pages: "build/prerendered/",
// minifierOptions: {
// minifyURLs: true,
2024-05-01 18:34:30 +01:00
// // Because of CSP hashing
// minifyJS: false, // We can pass a function here
// collapseWhitespace: false,
// sortAttributes: true,
// sortClassName: true,
// removeRedundantAttributes: true
// }
// }),
csp: {
mode: "auto",
directives: cspDirectives,
},
},
2024-02-13 16:38:14 +00:00
};
export default config;