Skip to content
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

feat: support vite.config.mts and vite.config.cts #22782

Merged
merged 2 commits into from
Jul 15, 2022

Conversation

haoqunjiang
Copy link
Contributor

@haoqunjiang haoqunjiang commented Jul 14, 2022

It's added in Vite 3.0:
vitejs/vite#8729

User facing changelog

Features:

  • Support vite.config.mts and vite.config.cts

Additional details

  • Why was this change necessary?

As of Vite 3.0, .mts and .cts extensions are properly supported.
Not sure what's happening here, but seems an issue due to the config file transformation in Vite 3 in combination with the ts-node used internally in Cypress.

So, in a package without "type": "module", using import.meta in a plain .ts file is equivalent to using it in a .cts file, which leads to a syntax error.

image

The fix is to either convert the package to type: "module" as a whole (which would bring many unexpected side effects), or use a proper .mts extension (which Cypress 10.3.0 doesn't yet support). Thus this PR.

Steps to test

How has the user experience changed?

PR Tasks

  • [na] Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 14, 2022

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Jul 14, 2022

CLA assistant check
All committers have signed the CLA.

@lmiller1990 lmiller1990 self-requested a review July 14, 2022 05:49
@lmiller1990
Copy link
Contributor

lmiller1990 commented Jul 14, 2022

Hi, thanks! Are you able to sign the CLA? #22782 (comment)

I think we still need more work for proper Vite 3 support, which I am tracking here: #22784, but we can merge this in the mean time, once the CLA is 🖊️ and the CI is ✔️

@haoqunjiang
Copy link
Contributor Author

Signed 😄

@lmiller1990
Copy link
Contributor

Cool, I triggered CI, should be ✔️, will keep an eye on it.

In the meantime I am looking at Vite 3 support, hopefully it won't be too many changes 👌

@astone123 astone123 self-requested a review July 15, 2022 14:36
Copy link
Contributor

@astone123 astone123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@cypress
Copy link

cypress bot commented Jul 15, 2022



Test summary

37721 0 456 0Flakiness 13


Run details

Project cypress
Status Passed
Commit da9636f
Started Jul 15, 2022 2:44 PM
Ended Jul 15, 2022 3:03 PM
Duration 18:19 💡
OS Linux Debian - 10.11
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

actions/click.cy.js Flakiness
1 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth
xhr.cy.js Flakiness
1 ... > logs request + response headers
2 ... > logs Method, Status, URL, and XHR
3 ... > logs response
4 ... > no status when request isnt forced 404
This comment includes only the first 5 flaky tests. See all 13 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@astone123 astone123 merged commit 8678053 into cypress-io:develop Jul 15, 2022
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.

4 participants