Socket
Book a DemoInstallSign in
Socket

@sveltejs/vite-plugin-svelte

Package Overview
Dependencies
Maintainers
4
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/vite-plugin-svelte

The official [Svelte](https://svelte.dev) plugin for [Vite](https://vitejs.dev).

version-5
Source
npmnpm
Version
5.1.1
Version published
Weekly downloads
1.4M
-31.71%
Maintainers
4
Weekly downloads
 
Created

What is @sveltejs/vite-plugin-svelte?

@sveltejs/vite-plugin-svelte is a Vite plugin that provides seamless integration with Svelte, a modern JavaScript framework for building user interfaces. This plugin allows developers to use Svelte with Vite, leveraging Vite's fast build times and hot module replacement (HMR) capabilities.

What are @sveltejs/vite-plugin-svelte's main functionalities?

Basic Setup

This code demonstrates how to include the @sveltejs/vite-plugin-svelte plugin in a Vite configuration file. This basic setup allows you to start using Svelte with Vite.

```json
{
  "plugins": [
    require('@sveltejs/vite-plugin-svelte')()
  ]
}
```

Hot Module Replacement (HMR)

This code sample shows how to enable Hot Module Replacement (HMR) with the @sveltejs/vite-plugin-svelte plugin. HMR allows you to see changes in your Svelte components instantly without a full page reload.

```json
{
  "plugins": [
    require('@sveltejs/vite-plugin-svelte')({
      hot: true
    })
  ]
}
```

Custom Svelte Compiler Options

This example demonstrates how to pass custom compiler options to the Svelte compiler using the @sveltejs/vite-plugin-svelte plugin. In this case, the `dev` option is set to `true` to enable development mode.

```json
{
  "plugins": [
    require('@sveltejs/vite-plugin-svelte')({
      compilerOptions: {
        dev: true
      }
    })
  ]
}
```

Other packages similar to @sveltejs/vite-plugin-svelte

Keywords

vite-plugin

FAQs

Package last updated on 11 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts