From b9da2f0c5d5c46be95456bf475c459ea9b5b18f9 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Fri, 16 Jun 2023 13:42:02 +0100 Subject: [PATCH] Fix package.json exports for Node.js <= 12.18 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We switched to “subpath patterns” recently (supported in Node.js 12.20+) but hadn’t realised that “subpath exports” with trailing slashes (not asterisks) were still needed for older versions We need both flavours because trailing slashes in exports were deprecated in Node.js 16 https://nodejs.org/docs/latest-v18.x/api/deprecations.html#dep0148-folder-mappings-in-exports-trailing- Fixes: https://github.com/alphagov/govuk-frontend/issues/3755 --- packages/govuk-frontend/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/govuk-frontend/package.json b/packages/govuk-frontend/package.json index 5f1791e692..bbcf7b03fe 100644 --- a/packages/govuk-frontend/package.json +++ b/packages/govuk-frontend/package.json @@ -17,7 +17,9 @@ "import": "./dist/govuk-esm/all.mjs", "require": "./dist/govuk/all.js" }, - "./*": "./*" + "./*": "./*", + "./dist/": "./dist/", + "./package.json": "./package.json" }, "sideEffects": [ "**/vendor/**"