Improve dev server with unified command and listhen integration #2566
+602
−3
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.
This PR enhances the development workflow by introducing a unified development server that combines webpack building, HTTP serving, and optional HTTPS tunneling in a single command using listhen.
Problem
The current development setup requires running two separate commands:
npm run dev
- starts webpack in watch modenpm run dev:server
- starts the HTTP serverThis creates friction in the development workflow and makes it difficult to test with live HTTPS websites that require secure connections.
Solution
New Development Commands
npm run dev:full
- The new recommended development command that:npm run dev:tunnel
- Enhanced development with HTTPS tunneling:dev:full
https://abc123.trycloudflare.com
Key Features
npm run dev
andnpm run dev:server
commands remain unchangedUsage Examples
Custom Checkout Integration
The tunnel feature is particularly valuable for Custom Checkout development:
Simply copy the HTTPS auto-loader URL into your BigCommerce store's Checkout Settings.
Implementation Details
scripts/dev-server.js
: Main unified server with webpack + listhen-based HTTP server + optional tunnelingscripts/test-dev-server.js
: Validation script ensuring everything works correctlyThe solution maintains full backward compatibility while providing a significantly improved developer experience through listhen's elegant HTTP server capabilities, automatic port selection, and built-in tunneling support.
Benefits of Listhen Integration
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.