From 30f35775c10c7bcd2484380628aa02430e4a6b54 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Fri, 20 Jan 2023 21:42:33 +0100 Subject: [PATCH 1/4] First stylistic pass --- packages/integrations/svelte/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/integrations/svelte/README.md b/packages/integrations/svelte/README.md index 854bded21061..913cd3b784b5 100644 --- a/packages/integrations/svelte/README.md +++ b/packages/integrations/svelte/README.md @@ -74,11 +74,11 @@ This package is maintained by Astro's Core team. You're welcome to submit an iss ## Options -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. +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. ### Default options -A few of the default options passed to the Svelte compiler are required to build properly for Astro and cannot be overridden. +This integration passes the following default options to the Svelte compiler: ```js const defaultOptions = { @@ -88,9 +88,9 @@ const defaultOptions = { }; ``` -The `emitCss`, `compilerOptions.dev`, and `compilerOptions.hydratable` cannot be overridden. +These `emitCss`, `compilerOptions.dev`, and `compilerOptions.hydratable` values are required to build properly for Astro and cannot be overridden. -Providing your own `preprocess` options **will** override the defaults - make sure to enable the preprocessor flags needed for your project. For example, +Providing your own `preprocess` options **will** override the `vitePreprocess()` default. Make sure to enable the preprocessor flags needed for your project. For example, ```js // astro.config.js @@ -110,7 +110,7 @@ export default { }; ``` -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. +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 on how it works. ## Intellisense for TypeScript From 9d206ea3c45abf8f16b5ae0a056cb22db95997ea Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sat, 21 Jan 2023 02:24:44 +0100 Subject: [PATCH 2/4] Rework for x/o instead of and --- packages/integrations/svelte/README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/integrations/svelte/README.md b/packages/integrations/svelte/README.md index 913cd3b784b5..9d63748b3b1b 100644 --- a/packages/integrations/svelte/README.md +++ b/packages/integrations/svelte/README.md @@ -90,10 +90,12 @@ const defaultOptions = { These `emitCss`, `compilerOptions.dev`, and `compilerOptions.hydratable` values are required to build properly for Astro and cannot be overridden. -Providing your own `preprocess` options **will** override the `vitePreprocess()` default. Make sure to enable the preprocessor flags needed for your project. For example, +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. + +You can set options either by passing them to the `svelte` integration `astro.config.mjs` or in `svelte.config.js`. Either of these would override the default `preprocess` setting: ```js -// astro.config.js +// astro.config.mjs import svelte from '@astrojs/svelte'; export default { @@ -101,8 +103,6 @@ export default { }; ``` -and - ```js // svelte.config.js export default { @@ -110,13 +110,12 @@ export default { }; ``` -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 on how it works. - ## Intellisense for TypeScript -If you're using a preprocessor like TypeScript or SCSS in your Svelte files, you can create a `svelte.config.js` file with: +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. ```js +// svelte.config.js import { vitePreprocess } from '@astrojs/svelte'; export default { @@ -124,4 +123,4 @@ export default { }; ``` -So the Svelte IDE extension can correctly parse the Svelte files. This config file is added by default when you run `astro add svelte`. +This config file will be automatically added for you when you run `astro add svelte`. From 77836f15301b67b041ebc58bc39e9fff01183587 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sat, 21 Jan 2023 10:47:09 +0100 Subject: [PATCH 3/4] fix typo Co-authored-by: Sarah Rainsberger --- packages/integrations/svelte/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/svelte/README.md b/packages/integrations/svelte/README.md index 9d63748b3b1b..f436ab2dd6d7 100644 --- a/packages/integrations/svelte/README.md +++ b/packages/integrations/svelte/README.md @@ -92,7 +92,7 @@ These `emitCss`, `compilerOptions.dev`, and `compilerOptions.hydratable` values 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. -You can set options either by passing them to the `svelte` integration `astro.config.mjs` or in `svelte.config.js`. Either of these would override the default `preprocess` setting: +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: ```js // astro.config.mjs From 046006b90813d1ddf9e9b2152a31dc7b8bc0365a Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sat, 21 Jan 2023 10:53:09 +0100 Subject: [PATCH 4/4] Add changeset --- .changeset/lucky-ants-push.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lucky-ants-push.md diff --git a/.changeset/lucky-ants-push.md b/.changeset/lucky-ants-push.md new file mode 100644 index 000000000000..0bad84f47533 --- /dev/null +++ b/.changeset/lucky-ants-push.md @@ -0,0 +1,5 @@ +--- +"@astrojs/svelte": patch +--- + +Improve README