-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.js
38 lines (32 loc) · 1.3 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
import preProcess from 'svelte-preprocess';
const globals = [...'onReady,elems,elem,createElem,show,hide,trigger,listen,wretch,api,signInUrl'.split(','), ...Object.keys(globalThis)];
export default {
preprocess: [
preProcess({
replace: [
[/{#else if /gim, '{:else if '],
[/{#elseif /gim, '{:else if '],
[/{#else}/gim, '{:else}'],
[/{#endif}/gim, '{/if}'],
[/{#endeach}/gim, '{/each}'],
[/{#then /gim, '{:then '],
[/{#catch /gim, '{:catch '],
[/{#endawait}/gim, '{/await}'],
[/{#endkey}/gim, '{/key}'],
[/{#depend /gim, '{#key '],
[/{#enddepend}/gim, '{/key}'],
[/{#endepend}/gim, '{/key}'],
[/{#debug /gim, '{@debug '],
[/{#html /gim, '{@html '],
['$_GLOBAL_BASE_URL', String(globalThis.BASE_URL||'').replace(/\/+$/, '')],
['$_GLOBAL_API_URL', globalThis.API_URL],
['$_GLOBAL_SESS_API_URL', globalThis.SESS_API_URL],
]
}),
],
onwarn(warn, next) {
// skip warnings
if (warn.code === 'missing-declaration' && globals.includes(warn.message.split("'")[1]));
else next(warn)
},
}