-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add support for preview dev server #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for a preview development server by configuring Vite's preview mode and implementing watch mode for the esbuild build process. The changes enable developers to run a development server that watches for file changes and automatically rebuilds the project.
Key changes:
- Added preview server configuration to Vite with specific port and CORS settings
- Implemented a new dev script that runs esbuild in watch mode alongside the Vite preview server
- Refactored esbuild build process to support both watch and one-time build modes using esbuild contexts
- Added DynamicCardList component to public exports
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| vite.config.ts | Adds preview server configuration with port 40510, disabled auto-open, and CORS enabled |
| package.json | Introduces new dev script combining esbuild watch mode with vite preview |
| esbuild.mjs | Refactors build process from direct builds to context-based approach supporting watch mode |
| src/main.ts | Exports new DynamicCardList component from public API |
| }, | ||
| "scripts": { | ||
| "build": "tsc --project tsconfig.types.json && node esbuild.mjs && npm run typedoc", | ||
| "dev": "node esbuild.mjs --watch & vite preview --outDir dist", |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ampersand operator (&) runs the esbuild process in the background, but this can cause issues with proper cleanup and signal handling. If the dev script is terminated, the background esbuild process may continue running. Consider using a tool like concurrently or npm-run-all to run both commands in parallel, or use the double ampersand (&&) if sequential execution is intended.
| }, | ||
| "scripts": { | ||
| "build": "tsc --project tsconfig.types.json && node esbuild.mjs && npm run typedoc", | ||
| "dev": "node esbuild.mjs --watch & vite preview --outDir dist", |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --outDir flag is not a valid option for vite preview command. The vite preview command serves the built output from the directory specified in the build.outDir config option (which defaults to 'dist'). This flag will be ignored by vite preview, making it misleading. Remove the --outDir dist argument from this command.
| "dev": "node esbuild.mjs --watch & vite preview --outDir dist", | |
| "dev": "node esbuild.mjs --watch & vite preview", |
Context
Related Jira ticket
Screenshots