-
Notifications
You must be signed in to change notification settings - Fork 5
/
svelte.config.js
63 lines (57 loc) · 1.47 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
import { mdsvex } from 'mdsvex';
import preprocess from 'svelte-preprocess';
import mdsvexConfig from './mdsvex.config.js';
import adapterStatic from '@sveltejs/adapter-static';
const env = (type) => process.env.npm_lifecycle_event === type;
const primaryColor = env('package') ? '' : '$primary-color: hsl(215, 15%, 33%);';
const options = {
sourceMap: env('dev'),
scss: {
prependData: `
${primaryColor}
@import './node_modules/spectre.css/src/variables';
@import './node_modules/spectre.css/src/mixins';
@import './src/lib/dark';
`,
quietDeps: true,
renderSync: true,
},
typescript: true,
};
/** @type {import('@sveltejs/kit').Config} */
export default {
// https://github.com/sveltejs/svelte-preprocess
compilerOptions: { immutable: false },
preprocess: [preprocess(options), mdsvex(mdsvexConfig)],
extensions: ['.svelte', ...mdsvexConfig.extensions],
onwarn: (warning, handler) => {
const ignore = [
'a11y-invalid-attribute',
'a11y-label-has-associated-control',
'a11y-missing-content',
'a11y-structure',
'a11y-autofocus',
'css-unused-selector',
'missing-declaration',
'unused-export-let',
];
if (ignore.includes(warning.code)) return;
console.log('w:', warning);
handler(warning);
},
kit: {
adapter: adapterStatic(),
files: {
assets: 'src/www/assets',
routes: 'src/www',
appTemplate: 'src/www/app.html',
},
prerender: {
handleMissingId: 'warn',
},
},
package: {
dir: 'package',
emitTypes: true,
},
};