Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions packages/plugin-react-swc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@
import * as vite from 'vite'
import { exactRegex } from '@rolldown/pluginutils'

/* eslint-disable no-restricted-globals */
const _dirname =
typeof __dirname !== 'undefined'
? __dirname
: dirname(fileURLToPath(import.meta.url))
const resolve = createRequire(
typeof __filename !== 'undefined' ? __filename : import.meta.url,
).resolve
/* eslint-enable no-restricted-globals */
const _dirname = dirname(fileURLToPath(import.meta.url))
const resolve = createRequire(import.meta.url).resolve

type Options = {
/**
Expand Down Expand Up @@ -112,7 +105,7 @@
load: {
filter: { id: exactRegex(runtimePublicPath) },
handler: (id) =>
id === runtimePublicPath

Check failure on line 108 in packages/plugin-react-swc/src/index.ts

View workflow job for this annotation

GitHub Actions / copilot

The 'import.meta.dirname' is still an experimental feature and is not supported until Node.js 22.16.0 (backported: ^21.2.0, ^20.11.0). The configured version range is '^20.19.0 || >=22.12.0'
? readFileSync(
join(_dirname, 'refresh-runtime.js'),
'utf-8',
Expand Down
Loading