@rsvelte/vite-plugin-svelte 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +42 -5
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,13 +1,33 @@
1
- # @sveltejs/vite-plugin-svelte
1
+ # @rsvelte/vite-plugin-svelte
2
2
 
3
- The official [Svelte](https://svelte.dev) plugin for [Vite](https://vitejs.dev).
3
+ A [Vite](https://vitejs.dev) plugin for [Svelte](https://svelte.dev) 5, backed
4
+ by the Rust [rsvelte](https://github.com/baseballyama/rsvelte) compiler. It is a
5
+ fork of the official [`@sveltejs/vite-plugin-svelte`](https://github.com/sveltejs/vite-plugin-svelte)
6
+ whose compile / preprocess / HMR calls route through the rsvelte compiler (via
7
+ [`@rsvelte/vite-plugin-svelte-native`](https://www.npmjs.com/package/@rsvelte/vite-plugin-svelte-native))
8
+ instead of `svelte/compiler`, so you can build a Vite or SvelteKit app on the
9
+ Rust toolchain with the same plugin surface.
10
+
11
+ > **⚠️ Early stage.** A drop-in replacement for `@sveltejs/vite-plugin-svelte`,
12
+ > but treat it as experimental. Supports Vite 6, 7 and 8.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm install -D @rsvelte/vite-plugin-svelte
18
+ # pnpm add -D @rsvelte/vite-plugin-svelte
19
+ # yarn add -D @rsvelte/vite-plugin-svelte
20
+ ```
21
+
22
+ The Rust compiler is pulled in as a native binding via `optionalDependencies`,
23
+ resolved automatically for your platform.
4
24
 
5
25
  ## Usage
6
26
 
7
27
  ```js
8
28
  // vite.config.js
9
29
  import { defineConfig } from 'vite';
10
- import { svelte } from '@sveltejs/vite-plugin-svelte';
30
+ import { svelte } from '@rsvelte/vite-plugin-svelte';
11
31
 
12
32
  export default defineConfig({
13
33
  plugins: [
@@ -18,10 +38,27 @@ export default defineConfig({
18
38
  });
19
39
  ```
20
40
 
41
+ The plugin exposes the same API as the official plugin, including
42
+ `vitePreprocess` and `loadSvelteConfig`:
43
+
44
+ ```js
45
+ import { svelte, vitePreprocess } from '@rsvelte/vite-plugin-svelte';
46
+
47
+ export default {
48
+ plugins: [
49
+ svelte({
50
+ preprocess: [vitePreprocess()]
51
+ })
52
+ ]
53
+ };
54
+ ```
55
+
21
56
  ## Documentation
22
57
 
23
- - [Plugin options](../../docs/config.md)
24
- - [FAQ](../../docs/faq.md)
58
+ Because this is a fork of `@sveltejs/vite-plugin-svelte`, the upstream
59
+ [plugin options](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md)
60
+ and [FAQ](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md)
61
+ apply.
25
62
 
26
63
  ## License
27
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsvelte/vite-plugin-svelte",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "license": "MIT",
5
5
  "author": "dominikg",
6
6
  "files": [
@@ -36,10 +36,10 @@
36
36
  "dependencies": {
37
37
  "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0",
38
38
  "deepmerge": "^4.3.1",
39
- "magic-string": "^0.30.21",
39
+ "magic-string": "^1.0.0",
40
40
  "obug": "^2.1.0",
41
41
  "vitefu": "^1.1.1",
42
- "@rsvelte/vite-plugin-svelte-native": "^0.2.3"
42
+ "@rsvelte/vite-plugin-svelte-native": "^0.2.7"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "svelte": "^5.0.0",
@@ -48,7 +48,7 @@
48
48
  "devDependencies": {
49
49
  "@types/debug": "^4.1.12",
50
50
  "sass": "^1.94.2",
51
- "svelte": "^5.45.4",
51
+ "svelte": "^5.56.4",
52
52
  "vite": "^8.0.0"
53
53
  },
54
54
  "scripts": {