Description
Current behavior
I'm creating a custom framework definition using the Cypress CT definition template, as outlined in the Cypress documentation.
I modified the template to support only vite
as the bundler:
export default defineComponentFramework({
type: "cypress-ct-template",
name: "Example Dependency",
supportedBundlers: ["vite"],
detectors: [dep],
dependencies: (bundler) => {
return [dep];
},
});
However, when setting up Cypress through the wizard using this framework definition, the generated cypress.config.js
file incorrectly configures webpack
as the bundler:
Even though Cypress detects webpack
in the next step (which comes from another dependency and should not be used). Additionally, I have a vite.config.js
file in the project root.
After completing the wizard, the resulting Cypress configuration looks like this:
import { defineConfig } from "cypress";
export default defineConfig({
component: {
devServer: {
framework: "my-custom-framework",
bundler: "webpack",
},
},
});
Despite explicitly setting supportedBundlers: ["vite"]
, Cypress still selects webpack
. How can I ensure that vite
is correctly configured instead?
Desired behavior
Cypress should correctly set vite as the bundler in cypress.config.js, ensuring it aligns with the custom framework's supportedBundlers: ["vite"] configuration.
Test code to reproduce
- Clone cypress-ct-definition-template.
- Change supportedBundlers to ["vite"]
- In a simple project, initialize a new
package.json
(npm init
in the folder) and install Cypress along with the newly created definition from the template. - Run
npx cypress open
andnpx cypress open --component
.
Cypress Version
14.0.2
Node version
v20.11.0
Operating System
macOS 15.2
Debug Logs
Other
No response