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

Full vite support #718

Open
bmulholland opened this issue Nov 1, 2023 · 3 comments
Open

Full vite support #718

bmulholland opened this issue Nov 1, 2023 · 3 comments

Comments

@bmulholland
Copy link

bmulholland commented Nov 1, 2023

I'm upgrading to Vue 3 via Nuxt 3, which pretty much forces me into Vite. (I wish it weren't so.)

I'd like to maintain code coverage. I think this package is the only way to get cypress code coverage, right? It's used e.g. here https://github.com/nefayran/cypress-react-vite/blob/main/package.json

But this package also depends on a webpack preprocessor, and has peer dependencies of webpack and babel-loader, both of which aren't used for vite. I'm not using those, and would prefer not to be installing them. I also would prefer to avoid confusion, with my package.json having both webpack and vite.

@bmulholland bmulholland changed the title Peer deps wrong when used with vite Full vite support Nov 1, 2023
@tvsbrent
Copy link

tvsbrent commented Jan 24, 2024

I can say, from experience, that you do not need to install Webpack in your project to use this plugin. We recently migrated away from it and do not have it directly installed in the project. However, the @cypress/code-coverage library does have Webpack as a dev dependency, so you will have it present in that case. (It just won't be visible as a direct dependency of the project.)

In the case of Babel, I'm working through that now myself, but my current understanding is that I have to install any plugins Babel may need to transform the code. That means in my case I need @babel/preset-react and babel-plugin-istanbul, but don't need to install @babel/core and @babel/preset-env. Those last two are dev dependencies of the code coverage library.

I would like to step away completely from needing Babel, and I am looking at that, but that's a much bigger task, it seems.

@bmulholland
Copy link
Author

Yep, not actually required to install, but yarn does output:

➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ workspace:. doesn't provide babel-loader (p7a636), requested by @cypress/code-coverage.
➤ YN0002: │ workspace:. doesn't provide webpack (p224d8), requested by @cypress/code-coverage.

That's not accurate; they're not actually peer deps.

@crankoide
Copy link

Peer dependencies webpack and babel-loader should be optional with peerDependenciesMeta field in package.json.

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

No branches or pull requests

3 participants