Journal

< Back

December 7, 2023

Added local preview based on node adapter [14:30]

Because I cannot get the development mode to work locally (for now) and from the docs it seems, that it is quite different from the production mode, I decided to use the node adapter for a local preview. I have installed it with pnpm install @astrojs/node and added the following switch to astro.config.ts:

const adapter =
  process.env.ADAPTER === "node"
    ? node({
        mode: "standalone",
      })
    : vercel();

In package.json I have added the following script:

    "preview": "ADAPTER=node astro build; ADAPTER=node astro preview"

Offline support [14:45]

I read up on Joaquín comments in Discord and it seems, that I need to spend some more thoughts into offline functionality: