Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Peer deps wrong when used with vite[/-][+]Full vite support[/+]tvsbrent commentedon 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-coveragelibrary 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-reactandbabel-plugin-istanbul, but don't need to install@babel/coreand@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 commentedon Jan 24, 2024
Yep, not actually required to install, but yarn does output:
That's not accurate; they're not actually peer deps.
crankoide commentedon Oct 9, 2024
Peer dependencies webpack and babel-loader should be optional with peerDependenciesMeta field in package.json.