Skip to content

Conversation

@adamleithp
Copy link
Contributor

@adamleithp adamleithp commented Dec 19, 2025

The Problem

When a new developer runs bin/start, it calls bin/start-frontend which executes:
bin/turbo --filter=@posthog/frontend start-vite

The start-vite script in frontend/package.json:44 was running:
"start-vite": "pnpm build:products && concurrently ... "vite --host 0.0.0.0" ..."

However, the old esbuild-based scripts (build and start-http) included an additional step:
"build": "pnpm copy-scripts && pnpm build:esbuild"
"start-http": "pnpm clean && pnpm copy-scripts && pnpm build:esbuild --dev"

The copy-scripts command (frontend/bin/copy-posthog-js) copies built posthog-js files (array.js, surveys.js,
recorder files, etc.) from node_modules/posthog-js/dist/ to dist/ so they can be served by PostHog's CDN. This step
was missing from the vite flow.

Left, was original copy-scripts bash script, right is the new vite plugin
image

Changes

Add new vite plugin to copy files over

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants