forked from jsnbuchanan/crowd-funder-for-time-pwa
- Fix TypeScript compilation errors in platform services - Add missing rotateCamera method and isNativeApp property - Fix index.html path resolution for packaged Electron apps - Create separate Vite config for Electron renderer process - Migrate from nostr-tools to @nostr/tools via JSR for ESM compatibility - Update all Vite configs to handle mixed npm/JSR package management - Add comprehensive documentation in BUILDING.md - Fix preload script path resolution in packaged builds Resolves build failures with deep imports and missing UI in AppImage.
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import path from "path";
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
server: {
|
|
headers: {
|
|
'Cross-Origin-Opener-Policy': 'same-origin',
|
|
'Cross-Origin-Embedder-Policy': 'require-corp'
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
'@nostr/tools': path.resolve(__dirname, 'node_modules/@nostr/tools'),
|
|
'@nostr/tools/nip06': path.resolve(__dirname, 'node_modules/@nostr/tools/nip06'),
|
|
stream: 'stream-browserify',
|
|
util: 'util',
|
|
crypto: 'crypto-browserify'
|
|
},
|
|
mainFields: ['module', 'jsnext:main', 'jsnext', 'main'],
|
|
},
|
|
optimizeDeps: {
|
|
include: ['@nostr/tools', '@nostr/tools/nip06', '@jlongster/sql.js'],
|
|
esbuildOptions: {
|
|
define: {
|
|
global: 'globalThis'
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
sourcemap: true,
|
|
target: 'esnext',
|
|
chunkSizeWarningLimit: 1000,
|
|
commonjsOptions: {
|
|
include: [/node_modules/],
|
|
transformMixedEsModules: true
|
|
},
|
|
rollupOptions: {
|
|
external: ['stream', 'util', 'crypto'],
|
|
output: {
|
|
globals: {
|
|
stream: 'stream',
|
|
util: 'util',
|
|
crypto: 'crypto'
|
|
}
|
|
}
|
|
}
|
|
},
|
|
assetsInclude: ['**/*.wasm']
|
|
});
|