Svelte inside Aurelia
Libception. Learn how to use Svelte inside of your Aurelia applications.
Install Dependencies
npm install svelte npm install --save-dev @sveltejs/vite-plugin-svelte vite svelte-checknpm install --save-dev @tsconfig/svelte
Configure Vite
// vite.config.ts
import { defineConfig } from 'vite';
import aurelia from '@aurelia/vite-plugin';
import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte';
export default defineConfig({
plugins: [
aurelia(),
svelte({
extensions: ['.svelte', '.svelte.ts'],
preprocess: vitePreprocess(),
compilerOptions: {
hydratable: true
}
})
]
});TypeScript and Tooling Setup
Build a Svelte 5 Component
Share Reactive Props with .svelte.ts
Create the Aurelia Wrapper (Svelte 5)
Register and Use the Wrapper
Error Handling and Lifecycle Tips
Supporting Legacy Svelte 4 Components
Performance Considerations
Last updated
Was this helpful?