Skip to content

Commit 08382e5

Browse files
Copilothi-ogawa
andcommitted
Remove __filename and __dirname checks from plugin-react-swc
Co-authored-by: hi-ogawa <[email protected]>
1 parent 585d6c9 commit 08382e5

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/plugin-react-swc/src/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@ import {
2121
import * as vite from 'vite'
2222
import { exactRegex } from '@rolldown/pluginutils'
2323

24-
/* eslint-disable no-restricted-globals */
25-
const _dirname =
26-
typeof __dirname !== 'undefined'
27-
? __dirname
28-
: dirname(fileURLToPath(import.meta.url))
29-
const resolve = createRequire(
30-
typeof __filename !== 'undefined' ? __filename : import.meta.url,
31-
).resolve
32-
/* eslint-enable no-restricted-globals */
24+
const _dirname = dirname(fileURLToPath(import.meta.url))
25+
const resolve = createRequire(import.meta.url).resolve
3326

3427
type Options = {
3528
/**

0 commit comments

Comments
 (0)