-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.cjs
43 lines (39 loc) · 1.23 KB
/
svelte.config.cjs
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
const sveltePreprocess = require('svelte-preprocess');
const pkg = require('./package.json');
let { pages = 'build', assets = 'build' } = {}
/** @type {import('@sveltejs/kit').Config} */
module.exports = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [
sveltePreprocess({
defaults: {
style: "postcss",
},
postcss: true
}),
],
kit: {
// By default, `npm run build` will create a standard Node app.
// You can create optimized builds for different platforms by
// specifying a different adapter
adapter: {
name: '@sveltejs/adapter-static',
async adapt(builder) {
builder.copy_static_files(assets);
builder.copy_client_files(assets);
await builder.prerender({
force: true,
dest: pages
});
}
},
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: {
ssr: {
noExternal: Object.keys(pkg.dependencies || {})
}
}
}
};