Skip to content

feat(vite): unspecify vite version support - #17

Open
nicojs wants to merge 1 commit into
credred:mainfrom
nicojs:patch-1
Open

feat(vite): unspecify vite version support#17
nicojs wants to merge 1 commit into
credred:mainfrom
nicojs:patch-1

Conversation

@nicojs

@nicojs nicojs commented Aug 23, 2025

Copy link
Copy Markdown
Contributor

Don't be specific about the vite version. This will allow all users to update at their own pace. Indeed, new versions of vite might break karma-vite, but since we're using a stable API it probably wont.

Don't be specific about the vite version. This will allow all users to update at their own pace. Indeed, new versions of vite _might_ break `karma-vite`, but since we're using a stable API it probably wont.
@nicojs nicojs mentioned this pull request Aug 23, 2025
@pahen

pahen commented Sep 1, 2025

Copy link
Copy Markdown

Would be lovely if you can merge this @credred 🙏

@pahen

pahen commented Sep 5, 2025

Copy link
Copy Markdown

Adding this to package.json is a workaround until this PR is merged @nicojs

 "overrides": {
    "karma-vite": {
      "vite": "^7.1.3"
    }
  }

@sronveaux

Copy link
Copy Markdown

I just wanted to confirm I just used karma-vite for the first time, upgrading a big application from Vue2 with Vue-CLI to Vue3 with Vite which has a bunch of unit tests using Karma and it worked like a charm with Vite 7.1.x !

nicojs pushed a commit to stryker-mutator/stryker-js that referenced this pull request Oct 4, 2025
…#5294)" (#5502)

* chore(e2e): also remove force from package.json
* fix(karma): override karma-vite dependency

Using the workaround provided as mentioned in:
credred/karma-vite#17
@rajsite rajsite mentioned this pull request Dec 12, 2025
1 task
rajsite added a commit to ni/nimble that referenced this pull request Dec 12, 2025
rajsite added a commit to ni/nimble that referenced this pull request Dec 13, 2025
# Pull Request

## 🤨 Rationale

Uses vite instead of webpack for running karma tests. Has the following
benefits:
- Fast enough to target `.ts` source files so can avoid needing to build
manually first
- Starts running tests almost immediately (2-3 seconds) instead of
waiting for tdd, i.e. a components build followed by a full webpack
build (30-40 seconds)
- Improves workflow of focus a specific set of tests and run tests
- Reduces times on `nimble-component:test` on CI by about 10-15s (net
impact on full CI is minimal due to concurrency)

## 👩‍💻 Implementation

- Switch to karma-vite in karma config files
- Remove webpack deps from components
- Had to add overrides to use newer vite versions until it's addressed
in karma-vite, see: credred/karma-vite#17
- Looks like overrides only have an impact on root package.json:
https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides
- Also added a `build-components` top-level helper command
- Also aligned the browsers we test against across packages

## 🧪 Testing

Try it yourself, pretty amazing.
- Sync repo and npm install
- `npm run build-components`
- Focus a test (i.e. `fdescribe`), for example in `nimble-components`
(note that means source has changed since build)
- `npm run test-chrome`, should run against the latest source quickly
and finish

Local run and CI

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.

---------

Co-authored-by: rajsite <1588923+rajsite@users.noreply.github.com>
@pahen

pahen commented Mar 18, 2026

Copy link
Copy Markdown

Any chance this can be merged soon @credred ?

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.

3 participants