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
* First stylistic pass
* Rework for x/o instead of and
* fix typo
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Add changeset
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Copy file name to clipboardexpand all lines: packages/integrations/svelte/README.md
+10-11
Original file line number
Diff line number
Diff line change
@@ -74,11 +74,11 @@ This package is maintained by Astro's Core team. You're welcome to submit an iss
74
74
75
75
## Options
76
76
77
-
This integration is powered by `@sveltejs/vite-plugin-svelte`. To customize the Svelte compiler, options can be provided to the integration. See the `@sveltejs/vite-plugin-svelte`[docs](https://github.com/sveltejs/vite-plugin-svelte/blob/HEAD/docs/config.md) for more details.
77
+
This integration is powered by `@sveltejs/vite-plugin-svelte`. To customize the Svelte compiler, options can be provided to the integration. See the [`@sveltejs/vite-plugin-svelte` docs](https://github.com/sveltejs/vite-plugin-svelte/blob/HEAD/docs/config.md) for more details.
78
78
79
79
### Default options
80
80
81
-
A few of the default options passed to the Svelte compiler are required to build properly for Astro and cannot be overridden.
81
+
This integration passes the following default options to the Svelte compiler:
82
82
83
83
```js
84
84
constdefaultOptions= {
@@ -88,40 +88,39 @@ const defaultOptions = {
88
88
};
89
89
```
90
90
91
-
The`emitCss`, `compilerOptions.dev`, and `compilerOptions.hydratable` cannot be overridden.
91
+
These`emitCss`, `compilerOptions.dev`, and `compilerOptions.hydratable` values are required to build properly for Astro and cannot be overridden.
92
92
93
-
Providing your own `preprocess` options **will** override the defaults - make sure to enable the preprocessor flags needed for your project. For example,
93
+
Providing your own `preprocess` options **will** override the [`vitePreprocess()`](https://github.com/sveltejs/vite-plugin-svelte/blob/HEAD/docs/preprocess.md) default. Make sure to enable the preprocessor flags needed for your project.
94
+
95
+
You can set options either by passing them to the `svelte` integration in `astro.config.mjs` or in `svelte.config.js`. Either of these would override the default `preprocess` setting:
94
96
95
97
```js
96
-
// astro.config.js
98
+
// astro.config.mjs
97
99
importsveltefrom'@astrojs/svelte';
98
100
99
101
exportdefault {
100
102
integrations: [svelte({ preprocess: [] })],
101
103
};
102
104
```
103
105
104
-
and
105
-
106
106
```js
107
107
// svelte.config.js
108
108
exportdefault {
109
109
preprocess: [],
110
110
};
111
111
```
112
112
113
-
Will override the default `preprocess` option. You can read the [`vitePreprocess` docs](https://github.com/sveltejs/vite-plugin-svelte/blob/HEAD/docs/preprocess.md) for more information of how it works.
114
-
115
113
## Intellisense for TypeScript
116
114
117
-
If you're using a preprocessor like TypeScript or SCSS in your Svelte files, you can create a `svelte.config.js` file with:
115
+
If you're using a preprocessor like TypeScript or SCSS in your Svelte files, you can create a `svelte.config.js` file so that the Svelte IDE extension can correctly parse the Svelte files.
118
116
119
117
```js
118
+
// svelte.config.js
120
119
import { vitePreprocess } from'@astrojs/svelte';
121
120
122
121
exportdefault {
123
122
preprocess:vitePreprocess(),
124
123
};
125
124
```
126
125
127
-
So the Svelte IDE extension can correctly parse the Svelte files. This config file is added by default when you run `astro add svelte`.
126
+
This config file will be automatically added for you when you run `astro add svelte`.
0 commit comments