Comments (6)
Indeed, glob doesn't seem to be supported for server.deps.inline
.
Vite uses createFilter
utility https://github.com/vitejs/vite/blob/ec16a5efc04d8ab50301d184c20e7bd0c8d8f6a2/packages/vite/src/node/ssr/ssrExternal.ts#L38-L41 to support glob, but Vitest (vite-node) has a different logic to match patterns
vitest/packages/vite-node/src/externalize.ts
Lines 157 to 162 in f969fb0
I created a repro with simpler dependencies https://github.com/hi-ogawa/reproductions/tree/main/vitest-5911-deps-inline-glob
from vitest.
Thanks @hi-ogawa. I can work on a PR to support this behavior if that's whats recommended
from vitest.
vite-node processes ssr.noExternal
on resolved file paths, Vite processes it on bare imports, so we cannot apply the same filter.
from vitest.
vite-node processes
ssr.noExternal
on resolved file paths, Vite processes it on bare imports, so we cannot apply the same filter.
Ok. What would be the recommended approach with globs?
from vitest.
Ok. What would be the recommended approach with globs?
If I knew what to do with this, we would've already implemented it 😞
I don't know how to solve these, they were always resolved differently in Vite and Vitest. Vite can also resolve monorepo packages while Vitest expects that the package is in moduleDirectories
and the name and the folder are the same.
If it's fine to keep this difference, we can just apply the glob with the same rule - svelte/*
will be equal to node_modules/svelte/.+
from vitest.
Thanks @sheremet-va. I think it's fine to keep this difference, and note that globs are not expected to be inlined also
from vitest.
Related Issues (20)
- Getting this.coverageProvider?.generateCoverage is not a function with Vitest 2.0 HOT 4
- Snapshots do not generate CSS class definitions HOT 4
- Add support for advancing timers to the next animation frame
- Support spread parameters for extensions [in types] HOT 2
- documentation for `server.deps.fallbackCJS` is confusing HOT 2
- Vitest does not discover tests in workspaces
- Ability to customize the "assetPrefix" for HTML report. HOT 3
- Error: Vitest failed to access its internal state.
- NestJS E2E tests failing when using vitest (when using sequelize query) HOT 5
- `expect.getState().testPath` only works when called inside of test function
- Vitest TypeError. VItest not see global.d.ts file HOT 1
- Extend existing `list` command to output only a list of file names HOT 3
- stubs to contain events and props HOT 1
- Tasks (tests, suites, hooks) that are too fast show a duration of 0ms in Task results HOT 1
- TSC error with Vitest 2.0.5: missing declarations for "chai"
- Incorrect Branch Coverage with coverage-v8 in Browser Mode and export Declaration HOT 4
- Support for LCOV Reporter in Vitest UI to Improve Coverage Report Organization
- Plugin order not respected the same as dev or build. HOT 1
- Test with `expect(promise).resolves` with promise that never resolves and without `await` hangs
- Incorrect test results on *first* run after installing node_modules HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitest.