Skip to content

Conversation

@maijalintunokka
Copy link
Contributor

Context

Related Jira ticket

Screenshots

Copilot AI review requested due to automatic review settings December 11, 2025 13:20
Copy link
Contributor

Copilot AI left a 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",
Copy link

Copilot AI Dec 11, 2025

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.

Copilot uses AI. Check for mistakes.
},
"scripts": {
"build": "tsc --project tsconfig.types.json && node esbuild.mjs && npm run typedoc",
"dev": "node esbuild.mjs --watch & vite preview --outDir dist",
Copy link

Copilot AI Dec 11, 2025

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.

Suggested change
"dev": "node esbuild.mjs --watch & vite preview --outDir dist",
"dev": "node esbuild.mjs --watch & vite preview",

Copilot uses AI. Check for mistakes.
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.

2 participants