You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(vitePreprocess): ts is no longer preprocessed by default (#974)
* docs(vitePreprocess): change wording to show that script is no longer preprocessed by default
* docs(vitePreprocess): more details around new script default
* Apply suggestions from code review
Co-authored-by: Simon H <[email protected]>
---------
Co-authored-by: Simon H <[email protected]>
Copy file name to clipboardExpand all lines: docs/preprocess.md
+24-11
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
3
3
`vite-plugin-svelte` also exports Vite preprocessors to preprocess Svelte components using Vite's built-in transformers.
4
4
5
-
Compared to [`svelte-preprocess`](https://github.com/sveltejs/svelte-preprocess), Vite preprocessors share the same CSS configuration from the Vite config so you don't have to configure them twice. [`esbuild`](http://esbuild.github.io)is also used to transform TypeScript by default.
5
+
Compared to [`svelte-preprocess`](https://github.com/sveltejs/svelte-preprocess), Vite preprocessors share the same CSS configuration from the Vite config so you don't have to configure them twice. [`esbuild`](http://esbuild.github.io)can also be used to transform TypeScript.
6
6
7
7
However, `svelte-preprocess` does provide extra functionalities not available with Vite preprocessors, such as [template tag](https://github.com/sveltejs/svelte-preprocess#template-tag), [external files](https://github.com/sveltejs/svelte-preprocess#external-files), and [global styles](https://github.com/sveltejs/svelte-preprocess#global-style) ([though it's recommended to use import instead](./faq.md#where-should-i-put-my-global-styles)). If those features are required, you can still use `svelte-preprocess`, but make sure to turn off it's script and style preprocessing options.
A Svelte preprocessor that supports transforming TypeScript, PostCSS, SCSS, Less, Stylus, and SugarSS. These are transformed when the script or style tags have the respective `lang` attribute.
15
15
@@ -20,16 +20,29 @@ However, `svelte-preprocess` does provide extra functionalities not available wi
20
20
- SugarSS: `<style lang="sss">`
21
21
22
22
By default, PostCSS or LightningCSS ([if configured in Vite](https://vitejs.dev/config/shared-options.html#css-transformer)) is applied to all `<style>` tags.
23
+
If required, you can turn transforming off by setting the `style` option to `false`. The `style` option also accepts Vite's `InlineConfig` and `ResolvedConfig` types for advanced usage.
23
24
24
-
If required, you can turn script or style transforming off by setting the `script` or `style` option to `false`. The `style` option also accepts Vite's `InlineConfig` and `ResolvedConfig` types for advanced usage.
25
+
TypeScript is no longer preprocessed by default as Svelte 5 understands most syntax natively.
26
+
If you use TypeScript features that emit code (like `enum`, `using`, `accessors`, decorators or class declarations with visibility modifiers), you have to enable the script preprocessor by setting the `script` option to `true`.
0 commit comments