From 605ca15d9adee3ce14da6fcaa98cb14d9c03795c Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Wed, 31 Jan 2024 15:11:18 -0800 Subject: [PATCH] Utilize CJS require for 'read-package-json-fast' --- lib/read-package-json.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/read-package-json.js b/lib/read-package-json.js index ba7aa8b..069106e 100644 --- a/lib/read-package-json.js +++ b/lib/read-package-json.js @@ -6,6 +6,8 @@ */ 'use strict' +const readPackage = require('read-package-json-fast') + // ------------------------------------------------------------------------------ // Requirements // ------------------------------------------------------------------------------ @@ -23,7 +25,7 @@ const joinPath = require('path').join */ module.exports = function readPackageJson () { const path = joinPath(process.cwd(), 'package.json') - return import('read-package-json-fast').then(({ default: readPackage }) => readPackage(path)).then(body => ({ + return readPackage(path).then(body => ({ taskList: Object.keys(body.scripts || {}), packageInfo: { path, body } }))