-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsvelte.config.js
82 lines (77 loc) · 1.86 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import adapter from "@sveltejs/adapter-node";
import { optimizeCarbonImports } from "carbon-preprocess-svelte";
import { sveltePreprocess } from "svelte-preprocess/dist/autoProcess.js";
/** @type {import('@sveltejs/kit').Config} */
const config = {
// options passed to svelte.compile (https://svelte.dev/docs#compile-time-svelte-compile)
compilerOptions: {
enableSourcemap: true,
},
// an array of file extensions that should be treated as Svelte components
extensions: [".svelte"],
kit: {
adapter: adapter(),
alias: {},
appDir: "_app",
browser: {
hydrate: true,
router: true,
},
csp: {
mode: "auto",
directives: {
"default-src": undefined,
// ...
},
},
moduleExtensions: [".js", ".ts"],
files: {
assets: "static",
hooks: "src/hooks",
lib: "src/lib",
params: "src/params",
routes: "src/routes",
serviceWorker: "src/service-worker",
template: "src/app.html",
},
inlineStyleThreshold: 0,
methodOverride: {
parameter: "_method",
allowed: [],
},
outDir: ".svelte-kit",
package: {
dir: "package",
emitTypes: true,
// excludes all .d.ts and files starting with _ as the name
exports: (filepath) => !/^_|\/_|\.d\.ts$/.test(filepath),
files: () => true,
},
paths: {
assets: "",
base: "",
},
prerender: {
concurrency: 1,
crawl: true,
default: false,
enabled: true,
entries: ["*"],
onError: "fail",
},
routes: (filepath) =>
!/(?:(?:^_|\/_)|(?:^\.|\/\.)(?!well-known))/.test(filepath),
serviceWorker: {
register: true,
files: (filepath) => !/\.DS_Store/.test(filepath),
},
trailingSlash: "never",
version: {
name: Date.now().toString(),
pollInterval: 0,
},
},
// options passed to svelte.preprocess (https://svelte.dev/docs#compile-time-svelte-preprocess)
preprocess: [sveltePreprocess(), optimizeCarbonImports()],
};
export default config;