diff options
author | 2021-11-12 12:42:02 +0000 | |
---|---|---|
committer | 2021-11-12 12:42:02 +0000 | |
commit | 48ebbb80d4795f18b5fbd9384cc83ceca272bae0 (patch) | |
tree | 5cfa793875133263a9607e904a7e0f411d89990e /docs/src | |
parent | 5470fda3fe64fed5d303f118bb3009a0a1e51ddc (diff) | |
download | astro-48ebbb80d4795f18b5fbd9384cc83ceca272bae0.tar.gz astro-48ebbb80d4795f18b5fbd9384cc83ceca272bae0.tar.zst astro-48ebbb80d4795f18b5fbd9384cc83ceca272bae0.zip |
[ci] yarn format
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/pages/migration/0.21.0.md | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/docs/src/pages/migration/0.21.0.md b/docs/src/pages/migration/0.21.0.md index 5b7847cb4..bc3ce72a0 100644 --- a/docs/src/pages/migration/0.21.0.md +++ b/docs/src/pages/migration/0.21.0.md @@ -12,19 +12,17 @@ As a result, configurations written in `snowpack.config.mjs` should be moved int ```js // @ts-check -/** @type {import('astro').AstroUserConfig} */ -export default ({ +/** @type {import('astro').AstroUserConfig} */ +export default { renderers: [], vite: { - plugins: [] - } -}) + plugins: [], + }, +}; ``` To learn more about configuring Vite, please visit their [configuration guide](https://vitejs.dev/config/). - - ## Aliasing In Astro v0.21, import aliases can be added from `tsconfig.json` or `jsconfig.json`. @@ -42,8 +40,6 @@ In Astro v0.21, import aliases can be added from `tsconfig.json` or `jsconfig.js _These aliases are integrated automatically into [VSCode](https://code.visualstudio.com/docs/languages/jsconfig) and other editors._ - - ## Variables in Scripts & Styles In Astro v0.21, server-side variables can be passed into client-side `<style>` or `<script>`. @@ -65,8 +61,6 @@ const colors = { foregroundColor: "rgb(221 243 228)", backgroundColor: "rgb(24 1 <h-tick>✓</h-tick> ``` - - ## Components in Markdown In Astro v0.21, Components from any framework can be used within Markdown files. @@ -74,7 +68,7 @@ In Astro v0.21, Components from any framework can be used within Markdown files. ```md --- Layout: '...' -setup: | +setup: | import MyReactComponent from '../components/MyReactComponent.jsx' --- @@ -87,8 +81,6 @@ setup: | </MyReactComponent> ``` - - ## Environment Variables In Astro v0.21, environment variables can be loaded from `.env` files in your project directory. @@ -111,8 +103,6 @@ In this example, `PUBLIC_ANYBODY` will be available as `import.meta.env.PUBLIC_A > In prior releases, these variables were prefixed with `SNOWPACK_PUBLIC_` and required the `@snowpack/plugin-env` plugin. - - ## File Extensions In Astro v0.21, files need to be referenced by their actual extension, exactly as it is on disk. @@ -120,7 +110,7 @@ In Astro v0.21, files need to be referenced by their actual extension, exactly a ```tsx // Div.tsx export default function Div(props) { - return <div /> + return <div />; } ``` @@ -136,7 +126,7 @@ This same change applies to styles. ```scss // Div.scss div { - all: unset + all: unset; } ``` @@ -145,28 +135,22 @@ div { + <link rel="stylesheet" href={Astro.resolve('./Div.scss')}> ``` - - ## Plugins In Astro v0.21, Vite plugins may be configured within `astro.config.mjs`. ```js -import { imagetools } from 'vite-imagetools' +import { imagetools } from 'vite-imagetools'; export default { vite: { - plugins: [ - imagetools() - ] - } -} + plugins: [imagetools()], + }, +}; ``` To learn more about Vite plugins, please visit their [plugin guide](https://vitejs.dev/guide/using-plugins.html). - - ## Custom Renderers In Astro v0.21, plugins should now use `viteConfig()`. @@ -202,7 +186,5 @@ To learn more about Vite plugins, please visit their [plugin guide](https://vite > In prior releases, these were configured with `snowpackPlugin` or `snowpackPluginOptions`. - - -[Snowpack]: https://www.snowpack.dev -[Vite]: https://vitejs.dev +[snowpack]: https://www.snowpack.dev +[vite]: https://vitejs.dev |