Files
colanode/apps/desktop/vite.preload.config.ts

47 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2025-06-12 12:11:57 +02:00
/// <reference types="./forge.env.d.ts" />
Web version (#43) * Create client package * Create the UI package * Init web app * Use isomorphic 'ws' for web sockets * File and asset implementations * Use Opfs SAH version of sqlite in browser * Generate Svg sprites for emojis and icons * Include emojis sprite * Improve and refactor assets * More assets improvements * Implement emoji and icons db import as readonly * Improve import paths * Handle concurrency limits for sqlite * Fix event broadcast in web * Pass windowId for subscribe and unsubscribe queries in desktop * Remove asset context * Implement avatar upload/download with the new structure * Improve file handlings * Move the necessary dependencies to client and ui packages * Update packages * Improve open file dialog * Make sure database files are deleted in browser * Improve avatar loading * Improve file loading * Fix some assets * Implement asset caching for offline access * Small fixes and improvements * Use server instead of pre signed urls for file upload/download * Cleanup some client related metadata * Switch Axios with ky * Refactor mutation results * Minor concurrency fix * Refactor web sockets * Improve file uploading * Handle connection close on server * Use stream for downloading the file * Add config options for cors * Update document in all tabs on local change * Include necessary icons for web * Update docker compose * Implement server upgrade required component * Use correct client type and platform in web and desktop * Improve service worker * Improve versioning * Fix an import * Minor fixes * Update some user endpoints * Minor endpoint changes * Enable app badge for desktop * Add error handling in some database operations * Update mutation naming convention * Update query naming convention * Update event and some metadata naming conventions * Update event and job naming conventions in server * Update Github workflow files * Restructure assets directory * Update packages * Upgrade to Zod v4 * Upgrade to react 19 * Upgrade to tailwind v4 * Minor ui improvements * Fix some cursor pointers * Add browser not supported message in web * Enhance server create flow, allow insecure connections and custom api paths * Execute electron-rebuild as postinstall command * Update docker compose
2025-06-11 00:14:17 +02:00
import path from 'path';
2024-11-16 23:20:30 +01:00
import type { ConfigEnv, UserConfig } from 'vite';
import { defineConfig, mergeConfig } from 'vite';
2024-12-02 01:33:25 +01:00
2024-12-02 00:44:02 +01:00
import { external, getBuildConfig, pluginHotRestart } from './vite.base.config';
// https://vitejs.dev/config
2024-11-16 23:20:30 +01:00
export default defineConfig((env) => {
const forgeEnv = env as ConfigEnv<'build'>;
const { forgeConfigSelf } = forgeEnv;
const config: UserConfig = {
build: {
rollupOptions: {
external,
// Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`.
input: forgeConfigSelf.entry!,
output: {
format: 'cjs',
// It should not be split chunks.
inlineDynamicImports: true,
entryFileNames: '[name].js',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]',
},
},
},
2024-11-16 23:20:30 +01:00
plugins: [pluginHotRestart('reload')],
resolve: {
alias: {
Web version (#43) * Create client package * Create the UI package * Init web app * Use isomorphic 'ws' for web sockets * File and asset implementations * Use Opfs SAH version of sqlite in browser * Generate Svg sprites for emojis and icons * Include emojis sprite * Improve and refactor assets * More assets improvements * Implement emoji and icons db import as readonly * Improve import paths * Handle concurrency limits for sqlite * Fix event broadcast in web * Pass windowId for subscribe and unsubscribe queries in desktop * Remove asset context * Implement avatar upload/download with the new structure * Improve file handlings * Move the necessary dependencies to client and ui packages * Update packages * Improve open file dialog * Make sure database files are deleted in browser * Improve avatar loading * Improve file loading * Fix some assets * Implement asset caching for offline access * Small fixes and improvements * Use server instead of pre signed urls for file upload/download * Cleanup some client related metadata * Switch Axios with ky * Refactor mutation results * Minor concurrency fix * Refactor web sockets * Improve file uploading * Handle connection close on server * Use stream for downloading the file * Add config options for cors * Update document in all tabs on local change * Include necessary icons for web * Update docker compose * Implement server upgrade required component * Use correct client type and platform in web and desktop * Improve service worker * Improve versioning * Fix an import * Minor fixes * Update some user endpoints * Minor endpoint changes * Enable app badge for desktop * Add error handling in some database operations * Update mutation naming convention * Update query naming convention * Update event and some metadata naming conventions * Update event and job naming conventions in server * Update Github workflow files * Restructure assets directory * Update packages * Upgrade to Zod v4 * Upgrade to react 19 * Upgrade to tailwind v4 * Minor ui improvements * Fix some cursor pointers * Add browser not supported message in web * Enhance server create flow, allow insecure connections and custom api paths * Execute electron-rebuild as postinstall command * Update docker compose
2025-06-11 00:14:17 +02:00
'@colanode/desktop': path.resolve(__dirname, './src'),
'@colanode/core': path.resolve(__dirname, '../../packages/core/src'),
'@colanode/crdt': path.resolve(__dirname, '../../packages/crdt/src'),
'@colanode/client': path.resolve(
__dirname,
'../../packages/client/src'
),
'@colanode/ui': path.resolve(__dirname, '../../packages/ui/src'),
2024-11-16 23:20:30 +01:00
},
},
};
return mergeConfig(getBuildConfig(forgeEnv), config);
});