-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: support import.meta.resolve on Vite 7
#8493
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
Changes from 11 commits
a1d05cc
85a13c3
b2b5bf5
38720a8
807c14c
add181d
f0f8969
31c6142
96db3e7
8173d69
c7f081d
49711bb
259741b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import type { ContextModuleRunnerOptions } from '../moduleRunner/startModuleRunn | |
| import { runInThisContext } from 'node:vm' | ||
| import * as spyModule from '@vitest/spy' | ||
| import { EvaluatedModules } from 'vite/module-runner' | ||
| import { createNodeImportMeta } from '../moduleRunner/moduleRunner' | ||
| import { startVitestModuleRunner } from '../moduleRunner/startModuleRunner' | ||
| import { run } from '../runBaseTests' | ||
| import { provideWorkerState } from '../utils' | ||
|
|
@@ -52,6 +53,7 @@ export async function runBaseTests(method: 'run' | 'collect', state: WorkerGloba | |
| state, | ||
| evaluatedModules: state.evaluatedModules, | ||
| spyModule, | ||
| createImportMeta: createNodeImportMeta, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made it explicitly passed via |
||
| }) | ||
| const fileSpecs = ctx.files.map(f => | ||
| typeof f === 'string' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base class
ModuleRunneralso hasoptionsproperty, which later accessed forthis.options.createImportMetahttps://github.com/vitejs/vite/blob/84079a84ad94de4c1ef4f1bdb2ab448ff2c01196/packages/vite/src/module-runner/runner.ts#L342-L343. To avoid crashing the properly, I needed to rename this.