vite_plugin_library_well_known.ts

Declarations
#

2 declarations

view source

vite_plugin_library_well_known
#

vite_plugin_library_well_known.ts view source

(options?: VitePluginLibraryWellKnownOptions): Plugin<any>

Vite plugin that publishes package.json and library.json to .well-known/.

Requires a generated library.json file (created by library_gen from gro gen). The plugin reads this JSON file and publishes its metadata to .well-known/ for both dev and production builds.

Note: This plugin respects SvelteKit's base path configuration, so .well-known/ will be served at {base}.well-known/ (e.g., /my-app/.well-known/). This deviates from RFC 8615 which specifies .well-known should be at the domain root. This tradeoff allows the plugin to work correctly when apps are deployed to non-root paths.

Note: CORS headers are only set for the dev server. For production, configure CORS at the server level (nginx, Caddy, etc.) if cross-origin access is needed.

options

default {}

returns

Plugin<any>

examples

Example 1

VitePluginLibraryWellKnownOptions
#