From e717c51aa1e46d1a1aabdb7e770c248b93e437a6 Mon Sep 17 00:00:00 2001 From: Billy Biggs Date: Sat, 14 Jun 2025 22:30:00 -0700 Subject: Avoid import.meta.dirname to be backwards compatible to Node.js 18+ (#1058) --- scripts/start.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/start.js') diff --git a/scripts/start.js b/scripts/start.js index 16b8cb6c..64dccd76 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -18,10 +18,12 @@ // limitations under the License. import { spawn, execSync } from 'child_process'; -import { join } from 'path'; +import { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; import { readFileSync } from 'fs'; -const root = join(import.meta.dirname, '..'); +const __dirname = dirname(fileURLToPath(import.meta.url)); +const root = join(__dirname, '..'); const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf-8')); // check build status, write warnings to file for app to display if needed -- cgit v1.2.3