-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
28 lines (26 loc) · 933 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
import adapterAuto from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';
import adapterStatic from '@sveltejs/adapter-static';
import adapterVercel from '@sveltejs/adapter-vercel';
// console.log(process.argv, 'process.env.adapter');
const adapter = process.argv.includes('vercel') ? adapterVercel() : adapterStatic({
pages: 'dist',
runtime: 'nodejs18.x',
fallback: process.argv.includes('surge') ? '200.html' : 'index.html' // may differ from host to host
});
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
alias: {
'@': './src/*'
},
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: process.env.MODE === 'development' ? adapterAuto() : adapter
},
preprocess: preprocess({
less: {
prependData: '@import \'./src/styles/base.less\';'
}
})
};
export default config;