[PR #178] [MERGED] Add standalone self-host output and align init production scripts #373

Closed
opened 2026-05-06 12:39:29 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/178
Author: @sankalpmukim
Created: 2/27/2026
Status: Merged
Merged: 3/30/2026
Merged by: @james-elicx

Base: mainHead: feat/selfhost-standalone-build-start


📝 Commits (10+)

  • 17a416e feat: add standalone self-host output for vinext build
  • 09c9a2c Merge main into feat/selfhost-standalone-build-start, resolve conflicts
  • b8c22d4 fmt
  • d9d676b Address bonk review: fix duplicate PHASE constant, complete lazy-chunks extraction, remove dead imports, add process.exit to standalone path
  • c6eba51 Address bonk nits: document regex patterns, move PHASE re-exports to bottom, add assets field to BuildManifestChunk
  • 4f0a549 refactor(standalone): use Vite bundle graph for server externals instead of regex scan
  • 8dbc469 fix(standalone): copy vinext runtime deps, add node_modules filter to cpSync, remove unused pendingWrites
  • 15e8254 fix(standalone): address round-6 bonk nits — explicit root, manifest comment, pre-flight check, bare-specifier comment, export-from re-export
  • 2f8d0e8 fix(standalone): address round 7 bonk review comments
  • 242cc84 fix(standalone): address round 8 bonk review comments

📊 Changes

13 files changed (+1154 additions, -124 deletions)

View changed files

📝 README.md (+33 -20)
packages/vinext/src/build/standalone.ts (+334 -0)
📝 packages/vinext/src/check.ts (+4 -1)
📝 packages/vinext/src/cli.ts (+39 -4)
📝 packages/vinext/src/config/next-config.ts (+11 -3)
📝 packages/vinext/src/index.ts (+7 -85)
📝 packages/vinext/src/init.ts (+9 -2)
packages/vinext/src/plugins/server-externals-manifest.ts (+122 -0)
📝 packages/vinext/src/server/prod-server.ts (+1 -1)
packages/vinext/src/utils/lazy-chunks.ts (+87 -0)
packages/vinext/src/utils/vinext-root.ts (+31 -0)
📝 tests/init.test.ts (+14 -8)
tests/standalone-build.test.ts (+462 -0)

📄 Description

Summary

  • add output: \"standalone\" support in vinext build that emits dist/standalone with a runnable server.js, built artifacts, and copied runtime dependencies for self-hosted VPS deployments
  • add production-phase next.config loading for build mode, and extract computeLazyChunks into a shared utility so the production server no longer imports the full plugin module
  • update vinext init to add dev:vinext, build:vinext, and start:vinext scripts using the vinext CLI, plus docs/check metadata and new unit coverage

Testing

  • corepack pnpm vitest run tests/init.test.ts tests/standalone-build.test.ts
  • corepack pnpm exec oxlint packages/vinext/src/build/standalone.ts packages/vinext/src/cli.ts packages/vinext/src/init.ts packages/vinext/src/utils/lazy-chunks.ts tests/standalone-build.test.ts tests/init.test.ts packages/vinext/src/config/next-config.ts packages/vinext/src/server/prod-server.ts packages/vinext/src/index.ts packages/vinext/src/check.ts
  • corepack pnpm --filter vinext run build

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/178 **Author:** [@sankalpmukim](https://github.com/sankalpmukim) **Created:** 2/27/2026 **Status:** ✅ Merged **Merged:** 3/30/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `feat/selfhost-standalone-build-start` --- ### 📝 Commits (10+) - [`17a416e`](https://github.com/cloudflare/vinext/commit/17a416e3191e742bf26740dba7860fd4122a9410) feat: add standalone self-host output for vinext build - [`09c9a2c`](https://github.com/cloudflare/vinext/commit/09c9a2c657cbdc6559fafd82d3f92b1e67618323) Merge main into feat/selfhost-standalone-build-start, resolve conflicts - [`b8c22d4`](https://github.com/cloudflare/vinext/commit/b8c22d45497eb18b4bdd0c02ea9335e0c2bb30c1) fmt - [`d9d676b`](https://github.com/cloudflare/vinext/commit/d9d676b029283fc677cb1d5574fa35e319f14c08) Address bonk review: fix duplicate PHASE constant, complete lazy-chunks extraction, remove dead imports, add process.exit to standalone path - [`c6eba51`](https://github.com/cloudflare/vinext/commit/c6eba51e20b75d48d27d02d747d9d110c68bc9cf) Address bonk nits: document regex patterns, move PHASE re-exports to bottom, add assets field to BuildManifestChunk - [`4f0a549`](https://github.com/cloudflare/vinext/commit/4f0a549ef07a03b6857fc4af53c8eaf2e12fb6ab) refactor(standalone): use Vite bundle graph for server externals instead of regex scan - [`8dbc469`](https://github.com/cloudflare/vinext/commit/8dbc4699f167e03864f9a2cca24ed0405aa6e6ea) fix(standalone): copy vinext runtime deps, add node_modules filter to cpSync, remove unused pendingWrites - [`15e8254`](https://github.com/cloudflare/vinext/commit/15e82546a701108d9e36968513f50df63ee2a634) fix(standalone): address round-6 bonk nits — explicit root, manifest comment, pre-flight check, bare-specifier comment, export-from re-export - [`2f8d0e8`](https://github.com/cloudflare/vinext/commit/2f8d0e8d2bd8d3f70ec21a1e4932e798b5083613) fix(standalone): address round 7 bonk review comments - [`242cc84`](https://github.com/cloudflare/vinext/commit/242cc84b5109a0af53fc450e08175ecc5949f172) fix(standalone): address round 8 bonk review comments ### 📊 Changes **13 files changed** (+1154 additions, -124 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+33 -20) ➕ `packages/vinext/src/build/standalone.ts` (+334 -0) 📝 `packages/vinext/src/check.ts` (+4 -1) 📝 `packages/vinext/src/cli.ts` (+39 -4) 📝 `packages/vinext/src/config/next-config.ts` (+11 -3) 📝 `packages/vinext/src/index.ts` (+7 -85) 📝 `packages/vinext/src/init.ts` (+9 -2) ➕ `packages/vinext/src/plugins/server-externals-manifest.ts` (+122 -0) 📝 `packages/vinext/src/server/prod-server.ts` (+1 -1) ➕ `packages/vinext/src/utils/lazy-chunks.ts` (+87 -0) ➕ `packages/vinext/src/utils/vinext-root.ts` (+31 -0) 📝 `tests/init.test.ts` (+14 -8) ➕ `tests/standalone-build.test.ts` (+462 -0) </details> ### 📄 Description ## Summary - add `output: \"standalone\"` support in `vinext build` that emits `dist/standalone` with a runnable `server.js`, built artifacts, and copied runtime dependencies for self-hosted VPS deployments - add production-phase `next.config` loading for build mode, and extract `computeLazyChunks` into a shared utility so the production server no longer imports the full plugin module - update `vinext init` to add `dev:vinext`, `build:vinext`, and `start:vinext` scripts using the vinext CLI, plus docs/check metadata and new unit coverage ## Testing - `corepack pnpm vitest run tests/init.test.ts tests/standalone-build.test.ts` - `corepack pnpm exec oxlint packages/vinext/src/build/standalone.ts packages/vinext/src/cli.ts packages/vinext/src/init.ts packages/vinext/src/utils/lazy-chunks.ts tests/standalone-build.test.ts tests/init.test.ts packages/vinext/src/config/next-config.ts packages/vinext/src/server/prod-server.ts packages/vinext/src/index.ts packages/vinext/src/check.ts` - `corepack pnpm --filter vinext run build` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:29 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#373
No description provided.