From a0adacae594e4f89059b3ec81c441827c262a8da Mon Sep 17 00:00:00 2001 From: andresin87 Date: Thu, 9 Jan 2025 14:33:43 +0100 Subject: [PATCH] feat(packages/sui-dashboard): compatible with node 20 require fn way --- packages/sui-dashboard/package.json | 3 +++ packages/sui-dashboard/src/index.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/sui-dashboard/package.json b/packages/sui-dashboard/package.json index 88e05b97c..05657ad31 100644 --- a/packages/sui-dashboard/package.json +++ b/packages/sui-dashboard/package.json @@ -14,5 +14,8 @@ "@s-ui/helpers": "1", "commander": "8.3.0", "fast-glob": "3.2.11" + }, + "engines": { + "node": ">=20.0.0" } } diff --git a/packages/sui-dashboard/src/index.js b/packages/sui-dashboard/src/index.js index a6b29f59e..b47124494 100644 --- a/packages/sui-dashboard/src/index.js +++ b/packages/sui-dashboard/src/index.js @@ -1,7 +1,10 @@ import {readFileSync} from 'fs' +import {createRequire} from 'module' import fg from 'fast-glob' +const require = createRequire(import.meta.url) + const flat = arr => [].concat(...arr) const getPackageContent = filepath => JSON.parse(readFileSync(filepath))