Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Adds Vitest configuration to React and Web Components Vite templates to prevent browser test failures caused by dependency optimization issues during CodeGen end-to-end tests.

Changes

  • Vitest browser mode optimization: Added test.deps.optimizer.web.enabled: false to disable web worker dependency optimization during browser-based tests

Configuration

export default defineConfig({
  base: './',
  test: {
    deps: {
      optimizer: {
        web: {
          enabled: false,
        },
      },
    },
    browser: {
      enabled: true,
      provider: 'playwright',
      // ...
    },
  },
  // ...
})

Complements the existing base: './' configuration for improved path handling in generated projects.

Original prompt

This section details on the original issue you should resolve

<issue_title>[React, WC]: Failing CodeGen End2End tests with errors in vitest</issue_title>
<issue_description>Currently, there are some failing apps when running CodeGen End2End tests

For React:

For React and Web Components:

For Web Components:

<agent_instructions>The problems might be because of the spaces in the names of the apps. Probably changes in the vite configuration ?</agent_instructions>

Comments on the Issue (you are @copilot in this section)

  • Fixes IgniteUI/CodeGen#2180

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…th resolution with spaces

Co-authored-by: Hristo313 <57346540+Hristo313@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing CodeGen End2End tests in React and Web Components Fix Vite module resolution for apps with spaces in directory names Jan 30, 2026
Co-authored-by: Hristo313 <57346540+Hristo313@users.noreply.github.com>
Copilot AI changed the title Fix Vite module resolution for apps with spaces in directory names Revert unwanted yarn.lock changes Feb 2, 2026
Copilot AI requested a review from Hristo313 February 2, 2026 07:17
@coveralls
Copy link

coveralls commented Feb 2, 2026

Coverage Status

coverage: 70.369%. remained the same
when pulling 45c7661 on copilot/fix-codegen-end2end-tests
into 6370f0d on master.

Co-authored-by: Hristo313 <57346540+Hristo313@users.noreply.github.com>
Copilot AI changed the title Revert unwanted yarn.lock changes Add dependency optimizer configurations to Vite templates Feb 2, 2026
@Hristo313 Hristo313 marked this pull request as ready for review February 2, 2026 12:16
@Hristo313 Hristo313 requested a review from Copilot February 2, 2026 12:16
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 addresses failing CodeGen end-to-end tests in React and Web Components templates by adding Vite dependency optimization configurations to improve module resolution and prevent pre-bundling issues during testing.

Changes:

  • Added optimizeDeps: { exclude: [] } configuration to control dependency pre-bundling behavior
  • Disabled Vitest web optimizer (test.deps.optimizer.web.enabled: false) to prevent browser test failures
  • Added base: './' for improved relative path resolution

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/cli/templates/webcomponents/igc-ts/projects/_base/files/vite.config.ts Added base path, dependency optimization, and test optimizer configurations to Web Components Vite template
packages/cli/templates/react/igr-ts/projects/_base/files/vite.config.ts Added base path, dependency optimization, and test optimizer configurations to React Vite template

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Hristo313 <57346540+Hristo313@users.noreply.github.com>
Copilot AI changed the title Add dependency optimizer configurations to Vite templates Disable Vitest web optimizer for browser tests in Vite templates Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants