summaryrefslogtreecommitdiff
path: root/packages/integrations/vercel/src/static/adapter.ts
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-11-30 10:03:51 -0500
committerGravatar GitHub <noreply@github.com> 2023-11-30 10:03:51 -0500
commitfbf145af8a792ee7334be577fbdf0bba9782b4e7 (patch)
treea5212b8b8f12d734579db8a2bb90dd4c772cba44 /packages/integrations/vercel/src/static/adapter.ts
parentff8eadb95d34833baaf3ec7575bf4f293eae97da (diff)
parent05628aaa3c9a3702b59cbf3d0e99abf66df651df (diff)
downloadastro-fbf145af8a792ee7334be577fbdf0bba9782b4e7.tar.gz
astro-fbf145af8a792ee7334be577fbdf0bba9782b4e7.tar.zst
astro-fbf145af8a792ee7334be577fbdf0bba9782b4e7.zip
Merge pull request #9247 from withastro/next
Merge the `next` branch into `main` for the 4.0 release
Diffstat (limited to 'packages/integrations/vercel/src/static/adapter.ts')
-rw-r--r--packages/integrations/vercel/src/static/adapter.ts19
1 files changed, 4 insertions, 15 deletions
diff --git a/packages/integrations/vercel/src/static/adapter.ts b/packages/integrations/vercel/src/static/adapter.ts
index df2995c37..80b42b95d 100644
--- a/packages/integrations/vercel/src/static/adapter.ts
+++ b/packages/integrations/vercel/src/static/adapter.ts
@@ -41,10 +41,6 @@ function getAdapter(): AstroAdapter {
}
export interface VercelStaticConfig {
- /**
- * @deprecated
- */
- analytics?: boolean;
webAnalytics?: VercelWebAnalyticsConfig;
speedInsights?: VercelSpeedInsightsConfig;
imageService?: boolean;
@@ -53,7 +49,6 @@ export interface VercelStaticConfig {
}
export default function vercelStatic({
- analytics,
webAnalytics,
speedInsights,
imageService,
@@ -65,14 +60,8 @@ export default function vercelStatic({
return {
name: '@astrojs/vercel',
hooks: {
- 'astro:config:setup': async ({ command, config, injectScript, updateConfig, logger }) => {
- if (webAnalytics?.enabled || analytics) {
- if (analytics) {
- logger.warn(
- `The \`analytics\` property is deprecated. Please use the new \`webAnalytics\` and \`speedInsights\` properties instead.`
- );
- }
-
+ 'astro:config:setup': async ({ command, config, injectScript, updateConfig }) => {
+ if (webAnalytics?.enabled) {
injectScript(
'head-inline',
await getInjectableWebAnalyticsContent({
@@ -80,7 +69,7 @@ export default function vercelStatic({
})
);
}
- if (command === 'build' && (speedInsights?.enabled || analytics)) {
+ if (command === 'build' && speedInsights?.enabled) {
injectScript('page', 'import "@astrojs/vercel/speed-insights"');
}
const outDir = new URL('./static/', getVercelOutput(config.root));
@@ -91,7 +80,7 @@ export default function vercelStatic({
redirects: false,
},
vite: {
- ...getSpeedInsightsViteConfig(speedInsights?.enabled || analytics),
+ ...getSpeedInsightsViteConfig(speedInsights?.enabled),
},
...getAstroImageConfig(
imageService,