-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsvelte.config.js
52 lines (50 loc) · 1.18 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import autoprefixer from "autoprefixer";
import cssnano from "cssnano";
import preprocess from "svelte-preprocess";
import netlifyAdapter from "@sveltejs/adapter-netlify";
const testIdReplacements = [
/data-testid\s?=\s?".*?"/g,
/data-testid\s?=\s?'.*?'/g,
/data-testid\s?=\s?{.*?}/g,
].map((regex) => [regex, ""]);
/** @type {import('@sveltejs/kit').Config} */
export default {
kit: {
adapter: netlifyAdapter({
edge: true, // use Netlify edge functions
split: false, // do not use a separate function for each route
}),
files: {
assets: "assets",
hooks: {
server: "src/hooks",
},
lib: "src/lib",
routes: "src/routes",
appTemplate: "src/app.html",
},
inlineStyleThreshold: 100_000,
paths: {
assets: "",
base: "",
},
alias: {
"$data": "data",
"$data/*": "data/*",
"$lib": "src/lib",
"$lib/*": "src/lib/*",
},
},
preprocess: preprocess({
replace:
process.env.VITE_ENV === "production" ? testIdReplacements : undefined,
postcss: {
plugins: [
autoprefixer(),
cssnano({
preset: "default",
}),
],
},
}),
};