mirror of
https://github.com/LukeHagar/sveltekit-adapters.git
synced 2025-12-07 20:57:49 +00:00
- Added `nodemon` and `wait-on` as dependencies in the electron example's package.json for better development experience. - Updated the `dev` script to utilize `wait-on` for ensuring the Vite server is running before starting Electron. - Enhanced the README.md with clearer instructions and examples for configuring the adapter and its options. - Removed the `functions` option from the TypeScript definition to simplify the interface. - Cleaned up unused imports in setupHandler.js to streamline the code.
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import type { Adapter } from '@sveltejs/kit';
|
|
|
|
export interface AdapterOptions {
|
|
/**
|
|
* Output directory for the Electron app
|
|
* @default 'out'
|
|
*/
|
|
out?: string;
|
|
|
|
/**
|
|
* Whether to precompress static assets
|
|
* @default false
|
|
*/
|
|
precompress?: boolean;
|
|
}
|
|
|
|
/**
|
|
* SvelteKit adapter for Electron desktop apps
|
|
*
|
|
* This adapter:
|
|
* 1. Builds the SvelteKit app using the static adapter for client assets
|
|
* 2. Copies server files for SSR support
|
|
* 3. Copies prerendered pages
|
|
* 4. Provides a native Electron protocol handler that bypasses HTTP servers
|
|
* 5. Outputs a complete Electron app structure ready for packaging
|
|
*/
|
|
declare function adapter(options?: AdapterOptions): Adapter;
|
|
|
|
export default adapter;
|
|
|
|
export interface ElectronPluginOptions {
|
|
mainEntry?: string;
|
|
preloadEntry?: string;
|
|
mainOut?: string;
|
|
preloadOut?: string;
|
|
externalMain?: string[];
|
|
externalPreload?: string[];
|
|
}
|
|
|
|
/**
|
|
* Vite plugin to build Electron main/preload files
|
|
*/
|
|
export declare function electronPlugin(options?: ElectronPluginOptions): any;
|