-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
56 lines (48 loc) · 1.8 KB
/
svelte.config.js
File metadata and controls
56 lines (48 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* =========================================================================
svelte.config.js
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
This file is part of Network Pro.
========================================================================= */
import adapter from "@sveltejs/adapter-netlify"; // Netlify adapter for deployment
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; // Vite preprocessor for Svelte
const config = {
// Preprocessors for enhanced functionality (vitePreprocess + mdsvex for Markdown support + svelte-preprocess for PostCSS)
preprocess: [
vitePreprocess({
postcss: true,
mdsvex: {
extensions: [".svx", ".md"],
},
}),
],
kit: {
// Netlify adapter configuration
adapter: adapter({
edge: false, // Disable edge functions (optional, enable if needed)
split: false, // Disable splitting function files (optional, enable if needed),
}),
// Paths configuration for deployment
paths: {
base: "", // Always deploy to the root of the domain
},
prerender: {
// Handle HTTP errors during prerendering
handleHttpError: ({ path, _referrer, message }) => {
// Paths to ignore and warn about
const warnList = ["/...404"];
if (warnList.includes(path)) {
console.warn(`Prerender error at path: ${path}, message: ${message}`);
return;
}
// Otherwise, fail the build
throw new Error(message);
},
},
},
// File extensions for Svelte and mdsvex
extensions: [".svelte", ".svx", ".md"], // Added .md for Markdown support
};
export default config;
// PostCSS configuration is handled separately in postcss.config.cjs
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
// for more information about preprocessors