fix: development copy script missing from bin/start #43791
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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

Changes
Add new vite plugin to copy files over