summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2022-03-15 15:27:17 -0500
committerGravatar GitHub <noreply@github.com> 2022-03-15 15:27:17 -0500
commit2b76ee8d75d44492af18b9ead35293da7178930a (patch)
tree067e3732e6a0ffff70a3b7e38d7bb53c30341bf8 /examples
parent2d95541b52118f787144720cb28cdd64644b903a (diff)
downloadastro-2b76ee8d75d44492af18b9ead35293da7178930a.tar.gz
astro-2b76ee8d75d44492af18b9ead35293da7178930a.tar.zst
astro-2b76ee8d75d44492af18b9ead35293da7178930a.zip
Export defineConfig helper (#2803)
* feat: add astro/config entrypoint * chore: update examples to use `defineConfig` util * chore: prettier fix * chore: add changeset
Diffstat (limited to 'examples')
-rw-r--r--examples/blog-multiple-authors/astro.config.mjs12
-rw-r--r--examples/blog/astro.config.mjs13
-rw-r--r--examples/component/demo/astro.config.mjs12
-rw-r--r--examples/docs/astro.config.mjs12
-rw-r--r--examples/env-vars/astro.config.mjs8
-rw-r--r--examples/framework-alpine/astro.config.mjs12
-rw-r--r--examples/framework-lit/astro.config.mjs12
-rw-r--r--examples/framework-multiple/astro.config.mjs12
-rw-r--r--examples/framework-preact/astro.config.mjs12
-rw-r--r--examples/framework-react/astro.config.mjs12
-rw-r--r--examples/framework-solid/astro.config.mjs12
-rw-r--r--examples/framework-svelte/astro.config.mjs12
-rw-r--r--examples/framework-vue/astro.config.mjs12
-rw-r--r--examples/minimal/astro.config.mjs7
-rw-r--r--examples/non-html-pages/astro.config.mjs7
-rw-r--r--examples/portfolio/astro.config.mjs12
-rw-r--r--examples/ssr/astro.config.mjs2
-rw-r--r--examples/starter/astro.config.mjs12
-rw-r--r--examples/subpath/astro.config.mjs12
-rw-r--r--examples/with-markdown-plugins/astro.config.mjs12
-rw-r--r--examples/with-markdown-shiki/astro.config.mjs12
-rw-r--r--examples/with-markdown/astro.config.mjs12
-rw-r--r--examples/with-nanostores/astro.config.mjs12
-rw-r--r--examples/with-tailwindcss/astro.config.mjs12
-rw-r--r--examples/with-vite-plugin-pwa/astro.config.mjs13
25 files changed, 73 insertions, 205 deletions
diff --git a/examples/blog-multiple-authors/astro.config.mjs b/examples/blog-multiple-authors/astro.config.mjs
index a1516f292..a024b64b4 100644
--- a/examples/blog-multiple-authors/astro.config.mjs
+++ b/examples/blog-multiple-authors/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the Preact renderer to support Preact JSX components.
renderers: ['@astrojs/renderer-preact'],
});
diff --git a/examples/blog/astro.config.mjs b/examples/blog/astro.config.mjs
index b769e1743..f682daa06 100644
--- a/examples/blog/astro.config.mjs
+++ b/examples/blog/astro.config.mjs
@@ -1,14 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
- // Enable the Preact renderer to support Preact JSX components.
+// https://astro.build/config
+export default defineConfig({
renderers: ['@astrojs/renderer-preact'],
buildOptions: {
site: 'https://example.com/',
diff --git a/examples/component/demo/astro.config.mjs b/examples/component/demo/astro.config.mjs
index d68cea82c..c6e58dbdc 100644
--- a/examples/component/demo/astro.config.mjs
+++ b/examples/component/demo/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Comment out "renderers: []" to enable Astro's default component support.
renderers: [],
});
diff --git a/examples/docs/astro.config.mjs b/examples/docs/astro.config.mjs
index 075ab81fe..9f97b3a89 100644
--- a/examples/docs/astro.config.mjs
+++ b/examples/docs/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
renderers: [
// Enable the Preact renderer to support Preact JSX components.
'@astrojs/renderer-preact',
diff --git a/examples/env-vars/astro.config.mjs b/examples/env-vars/astro.config.mjs
index 67c95c240..e3579a160 100644
--- a/examples/env-vars/astro.config.mjs
+++ b/examples/env-vars/astro.config.mjs
@@ -1,8 +1,6 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
- // Comment out "renderers: []" to enable Astro's default component support.
+// https://astro.build/config
+export default defineConfig({
renderers: [],
});
diff --git a/examples/framework-alpine/astro.config.mjs b/examples/framework-alpine/astro.config.mjs
index 05fc24b01..9827239bb 100644
--- a/examples/framework-alpine/astro.config.mjs
+++ b/examples/framework-alpine/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// No renderers are needed for AlpineJS support, just use Astro components!
renderers: [],
});
diff --git a/examples/framework-lit/astro.config.mjs b/examples/framework-lit/astro.config.mjs
index 0e5346799..c86c77bf7 100644
--- a/examples/framework-lit/astro.config.mjs
+++ b/examples/framework-lit/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the lit renderer to support LitHTML components and templates.
renderers: ['@astrojs/renderer-lit'],
});
diff --git a/examples/framework-multiple/astro.config.mjs b/examples/framework-multiple/astro.config.mjs
index ce173ed92..90f8b2ca4 100644
--- a/examples/framework-multiple/astro.config.mjs
+++ b/examples/framework-multiple/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable many renderers to support all different kinds of components.
renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-svelte', '@astrojs/renderer-vue', '@astrojs/renderer-solid'],
});
diff --git a/examples/framework-preact/astro.config.mjs b/examples/framework-preact/astro.config.mjs
index a1516f292..a024b64b4 100644
--- a/examples/framework-preact/astro.config.mjs
+++ b/examples/framework-preact/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the Preact renderer to support Preact JSX components.
renderers: ['@astrojs/renderer-preact'],
});
diff --git a/examples/framework-react/astro.config.mjs b/examples/framework-react/astro.config.mjs
index 443a69232..b35ad27e9 100644
--- a/examples/framework-react/astro.config.mjs
+++ b/examples/framework-react/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the React renderer to support React JSX components.
renderers: ['@astrojs/renderer-react'],
});
diff --git a/examples/framework-solid/astro.config.mjs b/examples/framework-solid/astro.config.mjs
index 72c154cb3..c78642c43 100644
--- a/examples/framework-solid/astro.config.mjs
+++ b/examples/framework-solid/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the Solid renderer to support Solid JSX components.
renderers: ['@astrojs/renderer-solid'],
});
diff --git a/examples/framework-svelte/astro.config.mjs b/examples/framework-svelte/astro.config.mjs
index a22ba9c95..4452ef101 100644
--- a/examples/framework-svelte/astro.config.mjs
+++ b/examples/framework-svelte/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the Svelte renderer to support Svelte components.
renderers: ['@astrojs/renderer-svelte'],
});
diff --git a/examples/framework-vue/astro.config.mjs b/examples/framework-vue/astro.config.mjs
index 950355760..563e8b8fc 100644
--- a/examples/framework-vue/astro.config.mjs
+++ b/examples/framework-vue/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the Vue renderer to support Vue components.
renderers: ['@astrojs/renderer-vue'],
});
diff --git a/examples/minimal/astro.config.mjs b/examples/minimal/astro.config.mjs
index 67c95c240..c6e58dbdc 100644
--- a/examples/minimal/astro.config.mjs
+++ b/examples/minimal/astro.config.mjs
@@ -1,8 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Comment out "renderers: []" to enable Astro's default component support.
renderers: [],
});
diff --git a/examples/non-html-pages/astro.config.mjs b/examples/non-html-pages/astro.config.mjs
index 67c95c240..c6e58dbdc 100644
--- a/examples/non-html-pages/astro.config.mjs
+++ b/examples/non-html-pages/astro.config.mjs
@@ -1,8 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Comment out "renderers: []" to enable Astro's default component support.
renderers: [],
});
diff --git a/examples/portfolio/astro.config.mjs b/examples/portfolio/astro.config.mjs
index a1516f292..a024b64b4 100644
--- a/examples/portfolio/astro.config.mjs
+++ b/examples/portfolio/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the Preact renderer to support Preact JSX components.
renderers: ['@astrojs/renderer-preact'],
});
diff --git a/examples/ssr/astro.config.mjs b/examples/ssr/astro.config.mjs
index c96372f66..d54ab5929 100644
--- a/examples/ssr/astro.config.mjs
+++ b/examples/ssr/astro.config.mjs
@@ -1,6 +1,6 @@
// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+export default defineConfig({
renderers: ['@astrojs/renderer-svelte'],
vite: {
server: {
diff --git a/examples/starter/astro.config.mjs b/examples/starter/astro.config.mjs
index a5fc95e58..f8ad313bc 100644
--- a/examples/starter/astro.config.mjs
+++ b/examples/starter/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Set "renderers" to "[]" to disable all default, builtin component support.
renderers: [],
});
diff --git a/examples/subpath/astro.config.mjs b/examples/subpath/astro.config.mjs
index 2b41e4ce7..42ecf7db4 100644
--- a/examples/subpath/astro.config.mjs
+++ b/examples/subpath/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Comment out "renderers: []" to enable Astro's default component support.
buildOptions: {
site: 'http://example.com/blog',
diff --git a/examples/with-markdown-plugins/astro.config.mjs b/examples/with-markdown-plugins/astro.config.mjs
index c25530d6a..26d986ce1 100644
--- a/examples/with-markdown-plugins/astro.config.mjs
+++ b/examples/with-markdown-plugins/astro.config.mjs
@@ -1,15 +1,9 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
-
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
+import { defineConfig } from 'astro/config';
import astroRemark from '@astrojs/markdown-remark';
import addClasses from './add-classes.mjs';
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable Custom Markdown options, plugins, etc.
renderers: [],
markdownOptions: {
diff --git a/examples/with-markdown-shiki/astro.config.mjs b/examples/with-markdown-shiki/astro.config.mjs
index 59502b3a8..3e9c52479 100644
--- a/examples/with-markdown-shiki/astro.config.mjs
+++ b/examples/with-markdown-shiki/astro.config.mjs
@@ -1,14 +1,8 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
-
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
+import { defineConfig } from 'astro/config';
import astroRemark from '@astrojs/markdown-remark';
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable Custom Markdown options, plugins, etc.
renderers: [],
markdownOptions: {
diff --git a/examples/with-markdown/astro.config.mjs b/examples/with-markdown/astro.config.mjs
index cad67e3e4..f5069ec18 100644
--- a/examples/with-markdown/astro.config.mjs
+++ b/examples/with-markdown/astro.config.mjs
@@ -1,12 +1,6 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-svelte', '@astrojs/renderer-vue'],
});
diff --git a/examples/with-nanostores/astro.config.mjs b/examples/with-nanostores/astro.config.mjs
index ce173ed92..90f8b2ca4 100644
--- a/examples/with-nanostores/astro.config.mjs
+++ b/examples/with-nanostores/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable many renderers to support all different kinds of components.
renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-svelte', '@astrojs/renderer-vue', '@astrojs/renderer-solid'],
});
diff --git a/examples/with-tailwindcss/astro.config.mjs b/examples/with-tailwindcss/astro.config.mjs
index a1516f292..a024b64b4 100644
--- a/examples/with-tailwindcss/astro.config.mjs
+++ b/examples/with-tailwindcss/astro.config.mjs
@@ -1,13 +1,7 @@
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
+import { defineConfig } from 'astro/config';
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
// Enable the Preact renderer to support Preact JSX components.
renderers: ['@astrojs/renderer-preact'],
});
diff --git a/examples/with-vite-plugin-pwa/astro.config.mjs b/examples/with-vite-plugin-pwa/astro.config.mjs
index a14546663..7f5cebf51 100644
--- a/examples/with-vite-plugin-pwa/astro.config.mjs
+++ b/examples/with-vite-plugin-pwa/astro.config.mjs
@@ -1,15 +1,8 @@
+import { defineConfig } from 'astro/config';
import { VitePWA } from 'vite-plugin-pwa';
-// Full Astro Configuration API Documentation:
-// https://docs.astro.build/reference/configuration-reference
-
-// @type-check enabled!
-// VSCode and other TypeScript-enabled text editors will provide auto-completion,
-// helpful tooltips, and warnings if your exported object is invalid.
-// You can disable this by removing "@ts-check" and `@type` comments below.
-
-// @ts-check
-export default /** @type {import('astro').AstroUserConfig} */ ({
+// https://astro.build/config
+export default defineConfig({
renderers: [],
vite: {
plugins: [VitePWA()],