summaryrefslogtreecommitdiff
path: root/packages/integrations/svelte/README.md
diff options
context:
space:
mode:
authorGravatar Subha Chanda <subhachanda88@gmail.com> 2023-01-27 00:33:00 +0530
committerGravatar GitHub <noreply@github.com> 2023-01-26 13:03:00 -0600
commit1c7eef308e808aa5ed4662b53e67ec8d1b814d1f (patch)
treedb310a2ce6c92ecc82bd75424f5f471ad0e72605 /packages/integrations/svelte/README.md
parent607f0ac31a43595252bc647c01ac4b75fc774202 (diff)
downloadastro-1c7eef308e808aa5ed4662b53e67ec8d1b814d1f.tar.gz
astro-1c7eef308e808aa5ed4662b53e67ec8d1b814d1f.tar.zst
astro-1c7eef308e808aa5ed4662b53e67ec8d1b814d1f.zip
Updated according to new configuration (#5478)
* Updated according to new configuration Astro imports the `defineConfig` function from `astro/config`. The `integrations` key needs to be passed into the `defineConfig` function, but it is not shown in the README. Updated the README according to the CLI example. * update alpine * update image * update lit * update mdx * update preact * update prefetch * update react * update sitemap * update solid * update svelte * update tailwind * update turbolinks * update vue * chore: add changeset * update image * update svelte readme Co-authored-by: Nate Moore <nate@astro.build> Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/svelte/README.md')
-rw-r--r--packages/integrations/svelte/README.md21
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/integrations/svelte/README.md b/packages/integrations/svelte/README.md
index 5367c8cdb..52d1fdc95 100644
--- a/packages/integrations/svelte/README.md
+++ b/packages/integrations/svelte/README.md
@@ -43,13 +43,14 @@ Now, apply this integration to your `astro.config.*` file using the `integration
__`astro.config.mjs`__
-```js
+```js ins={2} "svelte()"
+import { defineConfig } from 'astro/config';
import svelte from '@astrojs/svelte';
-export default {
+export default defineConfig({
// ...
integrations: [svelte()],
-}
+});
```
## Getting started
@@ -94,17 +95,20 @@ Providing your own `preprocess` options **will** override the [`vitePreprocess()
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:
+__`astro.config.mjs`__
+
```js
-// astro.config.mjs
+import { defineConfig } from 'astro/config';
import svelte from '@astrojs/svelte';
-export default {
+export default defineConfig({
integrations: [svelte({ preprocess: [] })],
-};
+});
```
+__`svelte.config.js`__
+
```js
-// svelte.config.js
export default {
preprocess: [],
};
@@ -116,8 +120,9 @@ export default {
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.
+__`svelte.config.js`__
+
```js
-// svelte.config.js
import { vitePreprocess } from '@astrojs/svelte';
export default {