feat(vercel): added warning when ENABLE_FILE_SYSTEM_API=1
is missing (#3139)
* Added warning in buildtime * Updated readme * Changeset
This commit is contained in:
parent
facf8016e2
commit
4ac3797344
3 changed files with 12 additions and 1 deletions
5
.changeset/soft-fishes-switch.md
Normal file
5
.changeset/soft-fishes-switch.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/vercel': patch
|
||||
---
|
||||
|
||||
Added warning when `ENABLE_FILE_SYSTEM_API` is not found
|
|
@ -13,7 +13,7 @@ export default defineConfig({
|
|||
});
|
||||
```
|
||||
|
||||
After you build your site the `.output/` folder will contain your server-side rendered app. Since this feature is still in beta, you'll **need to add this Enviroment Variable to your Vercel project**: `ENABLE_FILE_SYSTEM_API=1`
|
||||
After you build your site the `.output/` folder will contain your server-side rendered app. Since this feature is still in beta, you'll **need to add this Enviroment Variable to your Vercel project**: `ENABLE_FILE_SYSTEM_API=1`. [Learn how to set enviroment variables](https://vercel.com/docs/concepts/projects/environment-variables).
|
||||
|
||||
Now you can deploy!
|
||||
|
||||
|
|
|
@ -53,6 +53,12 @@ export default function vercel(): AstroIntegration {
|
|||
buildConfig.serverEntry = `${ENTRYFILE}.js`;
|
||||
buildConfig.client = new URL('./static/', _config.outDir);
|
||||
buildConfig.server = new URL('./server/pages/', _config.outDir);
|
||||
|
||||
if (String(process.env.ENABLE_FILE_SYSTEM_API) !== '1') {
|
||||
console.warn(
|
||||
`The enviroment variable "ENABLE_FILE_SYSTEM_API" was not found. Make sure you have it set to "1" in your Vercel project.\nLearn how to set enviroment variables here: https://vercel.com/docs/concepts/projects/environment-variables`
|
||||
);
|
||||
}
|
||||
},
|
||||
'astro:build:done': async ({ routes }) => {
|
||||
// Bundle dependecies
|
||||
|
|
Loading…
Reference in a new issue