Skip to content

API for Cloudflare Functions #963

Answered by brandonroberts
stewones asked this question in Q&A
Discussion options

You must be logged in to vote

@stewones Figured out the issue. Cloudflare adjusted the output directory for functions. This should work

import { defineConfig } from 'vite';
import analog from '@analogjs/platform';

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
  /// ...other config
  plugins: [
    analog({
      nitro: {
        output: {
          dir: './dist/analog/public',
          serverDir: './dist/analog/public/_worker.js',
        },
      },
    }),
  ],
}));

CF docs: https://developers.cloudflare.com/pages/functions/advanced-mode/

Will update the docs

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@brandonroberts
Comment options

@stewones
Comment options

@brandonroberts
Comment options

@brandonroberts
Comment options

Answer selected by stewones
@stewones
Comment options

@brandonroberts
Comment options

@stewones
Comment options

@stewones
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants