From 1503fb3c7bc2e9406c40d8668b2f9d57d81a8da8 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Thu, 15 Jun 2023 12:56:07 +0100 Subject: [PATCH] Fix package.json exports for Node.js < 12.20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We switched to “subpath patterns” recently (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 a205a38269..38e254306b 100644 --- a/packages/govuk-frontend/package.json +++ b/packages/govuk-frontend/package.json @@ -22,7 +22,9 @@ "import": "./dist/govuk-esm/all.mjs", "require": "./dist/govuk/all.js" }, - "./*": "./*" + "./*": "./*", + "./dist/": "./dist/", + "./package.json": "./package.json" }, "sideEffects": [ "**/vendor/**"