|
| 1 | +import { defineConfig, envField } from "astro/config"; |
| 2 | +import { loadEnv } from "vite"; |
| 3 | +import basicSsl from "@vitejs/plugin-basic-ssl"; |
| 4 | +import tailwind from "@astrojs/tailwind"; |
| 5 | +import storyblok from "@storyblok/astro"; |
| 6 | +import vue from "@astrojs/vue"; |
| 7 | +import icon from "astro-icon"; |
| 8 | +import sitemap from "@astrojs/sitemap"; |
| 9 | +import netlify from "@astrojs/netlify"; |
| 10 | +import vercel from "@astrojs/vercel/serverless"; |
| 11 | + |
| 12 | +const env = loadEnv("", process.cwd(), ["STORYBLOK", "NETLIFY"]); |
| 13 | + |
| 14 | +// https://astro.build/config |
| 15 | +export default defineConfig({ |
| 16 | + site: "https://unfolding.io/", |
| 17 | + output: "hybrid", |
| 18 | + adapter: env.NETLIFY ? netlify() : vercel(), // vercel() or netlify() |
| 19 | + integrations: [ |
| 20 | + storyblok({ |
| 21 | + accessToken: env.STORYBLOK_PREVIEW_TOKEN, |
| 22 | + bridge: false, |
| 23 | + components: { |
| 24 | + page: "components/bloks/Page", |
| 25 | + post: "components/bloks/Post", |
| 26 | + hero: "components/bloks/Hero", |
| 27 | + text_media: "components/bloks/TextMedia", |
| 28 | + blog_and_work_items: "components/bloks/BlogAndWorkItems", |
| 29 | + richtext: "components/bloks/RichText", |
| 30 | + banner: "components/bloks/Banner", |
| 31 | + features: "components/bloks/Features", |
| 32 | + work: "components/bloks/Work", |
| 33 | + service: "components/bloks/Service", |
| 34 | + gallery: "components/bloks/Gallery", |
| 35 | + services: "components/bloks/Services", |
| 36 | + stack_items: "components/bloks/StackItems", |
| 37 | + accordion: "components/bloks/premium/Accordion", |
| 38 | + pricing: "components/bloks/premium/Pricing", |
| 39 | + contact_form: "components/bloks/premium/ContactForm", |
| 40 | + carousel: "components/bloks/premium/Carousel", |
| 41 | + card_grid: "components/bloks/premium/CardGrid", |
| 42 | + newsletter: "components/bloks/premium/Newsletter", |
| 43 | + }, |
| 44 | + apiOptions: { |
| 45 | + region: env.STORYBLOK_REGION, // Possible values: "ap", "eu", "us", "ca", "cn" (Default: "eu") |
| 46 | + }, |
| 47 | + }), |
| 48 | + tailwind({ |
| 49 | + applyBaseStyles: false, |
| 50 | + }), |
| 51 | + vue({ |
| 52 | + appEntrypoint: "/src/pages/_app", |
| 53 | + }), |
| 54 | + icon( |
| 55 | + { |
| 56 | + iconDir: "src/icons", |
| 57 | + include: { |
| 58 | + lucide: [ |
| 59 | + 'chevron-right', |
| 60 | + 'chevron-left', |
| 61 | + 'chevron-up', |
| 62 | + 'chevron-down', |
| 63 | + 'arrow-right', |
| 64 | + 'arrow-left', |
| 65 | + 'arrow-up', |
| 66 | + 'arrow-down', |
| 67 | + 'external-link', |
| 68 | + 'mail', |
| 69 | + 'home', |
| 70 | + 'coffee', |
| 71 | + 'phone', |
| 72 | + 'smartphone', |
| 73 | + 'laptop', |
| 74 | + 'menu', |
| 75 | + 'newspaper', |
| 76 | + 'map', |
| 77 | + 'map-pin', |
| 78 | + 'search', |
| 79 | + 'image', |
| 80 | + 'badge-percent', |
| 81 | + 'facebook', |
| 82 | + 'banana', |
| 83 | + 'bitcoin', |
| 84 | + 'bookmark', |
| 85 | + 'bot', |
| 86 | + 'boxes', |
| 87 | + 'calendar-check', |
| 88 | + 'circle-check-big', |
| 89 | + 'download', |
| 90 | + 'cloud-download', |
| 91 | + 'github', |
| 92 | + 'messages-square', |
| 93 | + 'navigation', |
| 94 | + 'qr-code', |
| 95 | + 'play', |
| 96 | + 'shield-check', |
| 97 | + 'slack', |
| 98 | + 'star', |
| 99 | + 'thumbs-up', |
| 100 | + 'user-round', |
| 101 | + 'instagram' |
| 102 | + ], |
| 103 | + } |
| 104 | + } |
| 105 | + ), |
| 106 | + sitemap({ |
| 107 | + filter: (page) => |
| 108 | + !page.includes('/setup/') && |
| 109 | + !page.includes('/cms/') |
| 110 | + }), |
| 111 | + ], |
| 112 | + trailingSlash: "ignore", |
| 113 | + compressHTML: true, |
| 114 | + scopedStyleStrategy: "attribute", |
| 115 | + build: { |
| 116 | + format: "directory", |
| 117 | + inlineStylesheets: "always", |
| 118 | + }, |
| 119 | + vite: { |
| 120 | + plugins: [basicSsl()], |
| 121 | + server: { |
| 122 | + https: true, |
| 123 | + }, |
| 124 | + }, |
| 125 | + experimental: { |
| 126 | + contentLayer: true, |
| 127 | + |
| 128 | + env: { |
| 129 | + schema: { |
| 130 | + STORYBLOK_PREVIEW_TOKEN: envField.string({ |
| 131 | + context: "server", |
| 132 | + access: "secret", |
| 133 | + optional: true, |
| 134 | + }), |
| 135 | + STORYBLOK_SPACE_ID: envField.number({ |
| 136 | + context: "server", |
| 137 | + access: "public", |
| 138 | + optional: true, |
| 139 | + }), |
| 140 | + STORYBLOK_REGION: envField.string({ |
| 141 | + context: "server", |
| 142 | + access: "public", |
| 143 | + default: "eu", // Possible values: "ap", "eu", "us", "ca", "cn" (Default: "eu") |
| 144 | + }), |
| 145 | + STORYBLOK_PERSONAL_TOKEN: envField.string({ |
| 146 | + context: "server", |
| 147 | + access: "secret", |
| 148 | + optional: true, |
| 149 | + }), |
| 150 | + SITE_LANG: envField.string({ |
| 151 | + context: "client", |
| 152 | + access: "public", |
| 153 | + default: "en", |
| 154 | + }), |
| 155 | + CURRENCY: envField.string({ |
| 156 | + context: "client", |
| 157 | + access: "public", |
| 158 | + default: "USD", |
| 159 | + }), |
| 160 | + LOCALE: envField.string({ |
| 161 | + context: "client", |
| 162 | + access: "public", |
| 163 | + default: "en-US", |
| 164 | + }), |
| 165 | + NEWSLETTER_ENDPOINT: envField.string({ |
| 166 | + context: "server", |
| 167 | + access: "public", |
| 168 | + default: "none", |
| 169 | + }), |
| 170 | + MAILCHIMP_SERVER_PREFIX: envField.string({ |
| 171 | + context: "server", |
| 172 | + access: "public", |
| 173 | + optional: true, |
| 174 | + }), |
| 175 | + MAILCHIMP_LIST_ID: envField.string({ |
| 176 | + context: "server", |
| 177 | + access: "public", |
| 178 | + optional: true, |
| 179 | + }), |
| 180 | + MAILCHIMP_API_KEY: envField.string({ |
| 181 | + context: "server", |
| 182 | + access: "secret", |
| 183 | + optional: true, |
| 184 | + }), |
| 185 | + |
| 186 | + MAILGUN_API_KEY: envField.string({ |
| 187 | + context: "server", |
| 188 | + access: "secret", |
| 189 | + optional: true, |
| 190 | + }), |
| 191 | + |
| 192 | + MAILGUN_API_URL: envField.string({ |
| 193 | + context: "server", |
| 194 | + access: "public", |
| 195 | + optional: true, |
| 196 | + }), |
| 197 | + |
| 198 | + MAILGUN_DOMAIN: envField.string({ |
| 199 | + context: "server", |
| 200 | + access: "public", |
| 201 | + optional: true, |
| 202 | + }), |
| 203 | + |
| 204 | + FROM_EMAIL_ADDRESS: envField.string({ |
| 205 | + context: "server", |
| 206 | + access: "public", |
| 207 | + optional: true, |
| 208 | + }), |
| 209 | + |
| 210 | + TO_EMAIL_ADDRESS: envField.string({ |
| 211 | + context: "server", |
| 212 | + access: "public", |
| 213 | + optional: true, |
| 214 | + }), |
| 215 | + POSTMARK_SERVER_TOKEN: envField.string({ |
| 216 | + context: "server", |
| 217 | + access: "secret", |
| 218 | + optional: true, |
| 219 | + }), |
| 220 | + SLACK_TOKEN: envField.string({ |
| 221 | + context: "server", |
| 222 | + access: "secret", |
| 223 | + optional: true, |
| 224 | + }), |
| 225 | + SLACK_CHANNEL_ID: envField.string({ |
| 226 | + context: "server", |
| 227 | + access: "public", |
| 228 | + optional: true, |
| 229 | + }), |
| 230 | + CONTACT_FORM_ENDPOINT: envField.string({ |
| 231 | + context: "server", |
| 232 | + access: "public", |
| 233 | + default: "none", |
| 234 | + }), |
| 235 | + NEWSLETTER_ENDPOINT: envField.string({ |
| 236 | + context: "server", |
| 237 | + access: "public", |
| 238 | + default: "none", |
| 239 | + }), |
| 240 | + }, |
| 241 | + }, |
| 242 | + }, |
| 243 | +}); |
0 commit comments