forked from Akylas/OSS-DocumentScanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
41 lines (39 loc) · 1.34 KB
/
svelte.config.js
File metadata and controls
41 lines (39 loc) · 1.34 KB
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
const sveltePreprocess = require('svelte-preprocess');
const { existsSync } = require('fs');
const { resolve } = require('path');
let customPreprocess;
const customPath = resolve('./svelte.config.custom.js');
if (existsSync(customPath)) {
customPreprocess = require(customPath);
}
// this can be called either through svelte-loader where we want either __ANDROID__ or __IOS__ to be defined but not both
// or through svelte-check where we want both so everything is checked
const webpack_env = process.env['NATIVESCRIPT_WEBPACK_ENV']
? JSON.parse(process.env['NATIVESCRIPT_WEBPACK_ENV'])
: {
production: false,
android: true,
ios: true
};
module.exports = {
compilerOptions: {
namespace: 'foreign'
},
preprocess: [
sveltePreprocess({
replace: [
[/CARD_APP/g, process.env['APP_ID'] === 'com.akylas.cardwallet'],
[/PRODUCTION/g, !!webpack_env.production],
[/__ANDROID__/g, !!webpack_env.android],
[/__IOS__/g, !!webpack_env.ios]
].concat(customPreprocess?.replace || []),
typescript: {
compilerOptions: {
verbatimModuleSyntax: true,
target: 'es2020'
}
}
})
// svelteNativePreprocessor()
]
};