Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/vite-plugin-svelte

Package Overview
Dependencies
Maintainers
4
Versions
116
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).

  • 5.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
557K
increased by0.64%
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

FAQs

Package last updated on 12 Dec 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc