generated from yizhe-ang/svelte-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
svelte.config.js
32 lines (28 loc) · 822 Bytes
/
svelte.config.js
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
import adapter from "@sveltejs/adapter-auto";
import autoprefixer from "autoprefixer";
import { readFileSync } from "fs";
import sveltePreprocess from "svelte-preprocess";
const { subdirectory } = JSON.parse(readFileSync("package.json", "utf8"));
const dev = process.env.NODE_ENV === "development";
const dir = subdirectory || "";
const prefix = dir.startsWith("/") ? "" : "/";
const base = dev || !dir ? "" : `${prefix}${dir}`;
const preprocess = sveltePreprocess({
postcss: {
plugins: [autoprefixer]
}
});
const config = {
preprocess,
kit: {
adapter: adapter(),
// Prerender everything except pages that are explicitly marked as not prerenderable
// prerender: { default: true },
files: { lib: "./src" },
trailingSlash: "always"
},
paths: {
base
}
};
export default config;