Skip to content

Commit 577b7be

Browse files
committed
refactor: replace __dirname with import.meta.dirname for modern ESM compatibility
1 parent 3c7e34c commit 577b7be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/base.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { spawn } from 'child_process'
55
import { rimraf } from 'rimraf'
66
import kill from 'tree-kill'
77

8-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
8+
const dirname = import.meta.dirname
99
const isProd = process.env.NODE_ENV === 'production'
1010
const isDev = process.env.NODE_ENV === 'local'
1111
let inspectorProcess = null
@@ -14,8 +14,8 @@ let autoOpenBrowser = true
1414

1515
/** @type {import('esbuild').BuildOptions} */
1616
export const config = {
17-
entryPoints: [path.resolve(__dirname, '../src/index.ts')],
18-
outfile: path.resolve(__dirname, '../build/index.js'),
17+
entryPoints: [path.resolve(dirname, '../src/index.ts')],
18+
outfile: path.resolve(dirname, '../build/index.js'),
1919
format: 'esm',
2020
bundle: true,
2121
sourcemap: isDev,

0 commit comments

Comments
 (0)