coracle/vite.config.js

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-11-23 01:28:33 +00:00
import * as path from 'path'
2023-02-27 21:44:05 +00:00
import {defineConfig} from 'vite'
import {VitePWA} from 'vite-plugin-pwa'
2023-02-11 20:59:09 +00:00
import mkcert from 'vite-plugin-mkcert'
2023-02-03 23:01:29 +00:00
import sveltePreprocess from 'svelte-preprocess'
2023-02-27 21:44:05 +00:00
import {svelte} from '@sveltejs/vite-plugin-svelte'
import {nodePolyfills} from 'vite-plugin-node-polyfills'
2022-11-23 01:28:33 +00:00
export default defineConfig({
2023-02-11 20:59:09 +00:00
server: {
https: false,
},
2022-12-06 05:46:40 +00:00
build: {
sourcemap: true,
},
2022-11-23 01:28:33 +00:00
resolve: {
alias: {
src: path.resolve(__dirname, 'src'),
}
2022-11-23 01:28:33 +00:00
},
plugins: [
2023-02-11 20:59:09 +00:00
mkcert(),
nodePolyfills({
protocolImports: true,
}),
2023-02-27 21:44:05 +00:00
VitePWA({
registerType: 'autoUpdate',
injectRegister: 'auto',
manifest: {
name: 'Coracle',
short_name: 'Coracle',
description: 'Nostr, your way.',
theme_color: '#EB5E28',
icons: [
{type: "image/png", sizes: "192x192", src: "/images/favicon/android-icon-192x192.png"},
{type: "image/png", sizes: "512x512", src: "/images/favicon/android-icon-512x512.png"},
],
},
}),
svelte({
2023-02-03 23:01:29 +00:00
preprocess: sveltePreprocess(),
onwarn: (warning, handler) => {
2023-02-03 23:01:29 +00:00
2023-02-06 21:09:08 +00:00
if (warning.code.startsWith('a11y-')) return
2023-02-03 23:01:29 +00:00
if (warning.filename.includes("node_modules")) return
handler(warning)
},
}),
],
2022-11-23 01:28:33 +00:00
})