From 55e7cc20dbd0dc1d8359a43e58e17efb103d9143 Mon Sep 17 00:00:00 2001 From: Malte Ubl Date: Mon, 26 Oct 2026 16:35:52 -0700 Subject: [PATCH] Have orderkit require its part when it loads Main resolves computed createRequire specifiers at run time, so a computed require inside a function no longer makes an island; one in module code still does. --- .../node-island/order/node_modules/orderkit/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/fixtures/node-island/order/node_modules/orderkit/index.js b/tests/fixtures/node-island/order/node_modules/orderkit/index.js index 072e3c4ff0..9d4bfa8f49 100644 --- a/tests/fixtures/node-island/order/node_modules/orderkit/index.js +++ b/tests/fixtures/node-island/order/node_modules/orderkit/index.js @@ -1,5 +1,6 @@ "use strict"; -// Loads its part through a computed specifier, so it runs in a Node island. +// Loads its part through a computed specifier when it loads, so it runs in +// a Node island. const { createRequire } = require("node:module"); -const parts = ["./thing"].map((p) => createRequire(__filename)(p)); +const parts = [createRequire(__filename)(["./thing"][0])]; exports.make = () => new parts[0].Thing();