Skip to content

Remove __filename and __dirname check from packages/plugin-react-swc/src/index.tsΒ #919

@hi-ogawa

Description

@hi-ogawa

/* 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 */

@AriPerkkio reported this check is broken when running vite through --eval based script. Probably this was only meant for esm/cjs support, but the package is now esm only, so we can probably remove this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions