Skip to content

Commit 4542e68

Browse files
breaking: stop re-exporting vitePreprocess (#11297)
--------- Co-authored-by: Rich Harris <rich.harris@vercel.com> Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 parent 4f71ea1 commit 4542e68

File tree

15 files changed

+162
-382
lines changed

15 files changed

+162
-382
lines changed

.changeset/nine-moles-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': major
3+
---
4+
5+
breaking: stop re-exporting vitePreprocess

documentation/docs/60-appendix/20-integrations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Preprocessors transform your `.svelte` files before passing them to the compiler
88

99
### `vitePreprocess`
1010

11-
`vite-plugin-svelte` offers a [`vitePreprocess`](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/preprocess.md) feature which utilizes Vite for preprocessing. It is capable of handling the language flavors Vite handles: TypeScript, PostCSS, SCSS, Less, Stylus, and SugarSS. For convenience, it is re-exported from the `@sveltejs/kit/vite` package. If you set your project up with TypeScript it will be included by default:
11+
`vite-plugin-svelte` offers a [`vitePreprocess`](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/preprocess.md) feature which utilizes Vite for preprocessing. It is capable of handling the language flavors Vite handles: TypeScript, PostCSS, SCSS, Less, Stylus, and SugarSS. If you set your project up with TypeScript it will be included by default:
1212

1313
```js
1414
// svelte.config.js
15-
import { vitePreprocess } from '@sveltejs/kit/vite';
15+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
1616

1717
export default {
1818
preprocess: [vitePreprocess()]

documentation/docs/60-appendix/30-migrating-to-sveltekit-2.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ If a form contains an `<input type="file">` but does not have an `enctype="multi
127127

128128
Previously, the generated `tsconfig.json` was trying its best to still produce a somewhat valid config when your `tsconfig.json` included `paths` or `baseUrl`. In SvelteKit 2, the validation is more strict and will warn when you use either `paths` or `baseUrl` in your `tsconfig.json`. These settings are used to generate path aliases and you should use [the `alias` config](configuration#alias) option in your `svelte.config.js` instead, to also create a corresponding alias for the bundler.
129129

130+
## `vitePreprocess` is no longer exported from `@sveltejs/kit/vite`
131+
132+
Since `@sveltejs/vite-plugin-svelte` is now a peer dependency, SvelteKit 2 no longer re-exports `vitePreprocess`. You should import it directly from `@svelte/vite-plugin-svelte`.
133+
130134
## Updated dependency requirements
131135

132136
SvelteKit 2 requires Node `18.13` or higher, and the following minimum dependency versions:

packages/create-svelte/shared/+default+checkjs/svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import adapter from '@sveltejs/adapter-auto';
2-
import { vitePreprocess } from '@sveltejs/kit/vite';
2+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

44
/** @type {import('@sveltejs/kit').Config} */
55
const config = {

packages/create-svelte/shared/+default+typescript/svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import adapter from '@sveltejs/adapter-auto';
2-
import { vitePreprocess } from '@sveltejs/kit/vite';
2+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

44
/** @type {import('@sveltejs/kit').Config} */
55
const config = {

packages/create-svelte/shared/+typescript/svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import adapter from '@sveltejs/adapter-auto';
2-
import { vitePreprocess } from '@sveltejs/kit/vite';
2+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

44
/** @type {import('@sveltejs/kit').Config} */
55
const config = {

packages/create-svelte/templates/default/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@neoconfetti/svelte": "^1.0.0",
1212
"@sveltejs/adapter-auto": "workspace:*",
1313
"@sveltejs/kit": "workspace:*",
14+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
1415
"svelte": "^4.2.8",
1516
"typescript": "^5.3.3",
1617
"vite": "^5.0.8"

packages/create-svelte/templates/default/svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import adapter from '@sveltejs/adapter-auto';
2-
import { vitePreprocess } from '@sveltejs/kit/vite';
2+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

44
// This config is ignored and replaced with one of the configs in the shared folder when a project is created.
55

packages/kit/src/exports/vite/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ import {
3737
sveltekit_paths
3838
} from './module_ids.js';
3939

40-
export { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
41-
4240
const cwd = process.cwd();
4341

4442
/** @type {import('./types.js').EnforcedConfig} */

packages/kit/types/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,6 @@ declare module '@sveltejs/kit/node/polyfills' {
18371837
}
18381838

18391839
declare module '@sveltejs/kit/vite' {
1840-
export { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
18411840
/**
18421841
* Returns the SvelteKit Vite plugins.
18431842
* */

0 commit comments

Comments
 (0)