-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvelte.config.cjs
55 lines (51 loc) · 1.35 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
44
45
46
47
48
49
50
51
52
53
54
55
// const node = require('@sveltejs/adapter-node');
const st = require('@sveltejs/adapter-static');
const { resolveConfig } = require('vite');
const pkg = require('./package.json');
const { resolve } = require('path');
const sveltePreprocess = require('svelte-preprocess');
/** @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: node(),
adapter: st(),
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: {
/**
* a.s. uncomment below when building w/ npm run build
* comment when using: npm run dev
*/
// ssr: {
// noExternal: Object.keys(pkg.dependencies || {})
// },
build: {
rollupOptions: {
output: {
intro: 'if(exports === undefined){var exports ={}; var self = {}}'
}
}
},
resolve: {
alias: {
'./runtimeConfig': './runtimeConfig.browser',
$stores: resolve(__dirname, './src/stores'),
$components: resolve(__dirname, './src/components')
}
}
}
}
};