-
Notifications
You must be signed in to change notification settings - Fork 5
/
svelte.config.js
46 lines (42 loc) · 1.09 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
import preprocess from 'svelte-preprocess';
import wasmPackPlugin from 'vite-plugin-wasm-pack';
const wasmPack = wasmPackPlugin.default;
const scssAliases = (aliases) => {
return (url) => {
for (const [alias, aliasPath] of Object.entries(aliases)) {
if (url.indexOf(alias) === 0) {
return {
file: url.replace(alias, aliasPath),
};
}
}
return url;
};
};
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [
preprocess({
scss: {
prependData: "@use '@/styles/abstracts' as *;",
importer: [
scssAliases({
'@/': process.cwd() + '/src/',
}),
],
},
}),
],
kit: {
target: '#app',
vite: {
resolve: {
alias: {
'@/': process.cwd() + '/src/',
},
},
plugins: [wasmPack([], 'kustom')],
},
},
};
export default config;