Rust implementation of NextGraph, a Decentralized and local-first web 3.0 ecosystem
https://nextgraph.org
byzantine-fault-tolerancecrdtsdappsdecentralizede2eeeventual-consistencyjson-ldlocal-firstmarkdownocapoffline-firstp2pp2p-networkprivacy-protectionrdfrich-text-editorself-hostedsemantic-websparqlweb3collaboration
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.3 KiB
74 lines
2.3 KiB
2 years ago
|
import { defineConfig } from "vite";
|
||
|
import { internalIpV4 } from 'internal-ip'
|
||
2 years ago
|
import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||
2 years ago
|
import sveltePreprocess from "svelte-preprocess";
|
||
1 year ago
|
import { viteSingleFile } from "vite-plugin-singlefile"
|
||
|
import svelteSVG from "vite-plugin-svelte-svg";
|
||
1 year ago
|
import wasm from "vite-plugin-wasm";
|
||
|
import topLevelAwait from "vite-plugin-top-level-await";
|
||
2 years ago
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig(async () => {
|
||
|
const host = await internalIpV4()
|
||
|
const config = {
|
||
|
plugins: [
|
||
1 year ago
|
wasm(),
|
||
|
topLevelAwait(),
|
||
2 years ago
|
svelte({
|
||
|
preprocess: [
|
||
2 years ago
|
vitePreprocess(),
|
||
2 years ago
|
sveltePreprocess({
|
||
|
typescript: true,
|
||
2 years ago
|
postcss: true,
|
||
2 years ago
|
}),
|
||
|
],
|
||
|
}),
|
||
1 year ago
|
svelteSVG({
|
||
|
svgoConfig: {
|
||
|
plugins: [
|
||
|
{
|
||
|
name: 'preset-default',
|
||
|
params: {
|
||
|
overrides: {
|
||
|
// disable plugins
|
||
|
removeViewBox: false,
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
}, // See https://github.com/svg/svgo#configuration
|
||
|
requireSuffix: true, // Set false to accept '.svg' without the '?component'
|
||
|
}),
|
||
2 years ago
|
],
|
||
|
|
||
|
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
||
|
// prevent vite from obscuring rust errors
|
||
|
clearScreen: false,
|
||
|
// tauri expects a fixed port, fail if that port is not available
|
||
|
server: {
|
||
2 years ago
|
port: process.env.NG_APP_WEB ? 1421 : 1420,
|
||
2 years ago
|
host: '0.0.0.0',
|
||
|
strictPort: true,
|
||
|
hmr: {
|
||
|
protocol: 'ws',
|
||
|
host,
|
||
2 years ago
|
port: process.env.NG_APP_WEB ? 5184 : 5183,
|
||
1 year ago
|
}
|
||
2 years ago
|
},
|
||
|
// to make use of `TAURI_DEBUG` and other env variables
|
||
|
// https://tauri.studio/v1/api/config#buildconfig.beforedevcommand
|
||
2 years ago
|
envPrefix: ["VITE_", "TAURI_", "NG_"],
|
||
2 years ago
|
build: {
|
||
1 year ago
|
outDir: process.env.NG_APP_WEB ? process.env.NG_APP_FILE ? 'dist-file' : 'dist-web' : 'dist',
|
||
2 years ago
|
// Tauri supports es2021
|
||
2 years ago
|
target: process.env.NG_APP_WEB ? 'modules' : process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13",
|
||
2 years ago
|
// don't minify for debug builds
|
||
|
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
|
||
|
// produce sourcemaps for debug builds
|
||
|
sourcemap: !!process.env.TAURI_DEBUG,
|
||
1 year ago
|
}
|
||
2 years ago
|
}
|
||
1 year ago
|
if (process.env.NG_APP_FILE) config.plugins.push(viteSingleFile());
|
||
2 years ago
|
return config
|
||
|
})
|