Skip to content

Full vite support #718

Open
Open

Description

@bmulholland

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.

Activity

  1. changed the title [-]Peer deps wrong when used with vite[/-] [+]Full vite support[/+] on Nov 1, 2023
  2. tvsbrent commented on Jan 24, 2024

    @tvsbrent

    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.

  3. bmulholland commented on Jan 24, 2024

    @bmulholland
    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.

  4. crankoide commented on Oct 9, 2024

    @crankoide

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions