-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvelte.config.js
63 lines (58 loc) · 1.69 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 preprocess from 'svelte-preprocess';
import vercelAdapter from '@sveltejs/adapter-vercel';
import staticIPFSAdapter from 'sveltejs-adapter-ipfs';
import adapter_static from '@sveltejs/adapter-static';
import path from 'path';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
import mm from 'micromatch';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: () => ({
build: {
rollupOptions: {}
// https://vitejs.dev/guide/build.html#library-mode
// lib: {
// entry: path.resolve(__dirname, 'src/lib/index.js'),
// name: 'portal',
// formats: ['es']
// fileName: (format) => `iframe-wallet.${format}.js`
// }
},
server: {
fs: {
// Allow serving files from levels up to the project root
allow: ['../../../']
}
}
}),
package: {
dir: 'dist',
exports: (filepath) => {
if (filepath.endsWith('.d.ts')) return false;
if (filepath == 'index.js') return true;
return mm.isMatch(filepath, ['!**/_*', '!**/internal/**']);
// return mm.isMatch(filepath, ['App.svelte', 'Portal.svelte']);
},
files: mm.matcher('!**/build.*')
},
serviceWorker: {
register: false
},
// adapter: staticIPFSAdapter({
// removeBuiltInServiceWorkerRegistration: true,
// injectPagesInServiceWorker: true
// })
adapter: adapter_static()
// adapter: vercelAdapter()
}
};
export default config;