From 6139a6296505befff6ab5549f46dc96a2f84cb54 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Thu, 23 Apr 2026 09:55:41 +0530 Subject: [PATCH] fix: add explicit /index.js to dayjs ESM import remap Host apps with "type": "module" using strict ESM resolvers (Node nodenext) fail to resolve bare dayjs/esm/plugin/ since dayjs lacks exports map for esm subpaths and plugin paths are directories. Append /index.js in rollup output paths to produce fully qualified imports that work across Bun, Node strict ESM, Vite SSR, and bundlers. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/raystack/rollup.config.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/raystack/rollup.config.mjs b/packages/raystack/rollup.config.mjs index 341224364..f2d014cf4 100644 --- a/packages/raystack/rollup.config.mjs +++ b/packages/raystack/rollup.config.mjs @@ -102,9 +102,9 @@ const rollupConfig = configs.map(conf => { preserveModules: true, preserveModulesRoot: conf.inputPath, paths: id => { - if (id === 'dayjs') return 'dayjs/esm'; + if (id === 'dayjs') return 'dayjs/esm/index.js'; if (id.startsWith('dayjs/plugin/')) - return id.replace('dayjs/plugin/', 'dayjs/esm/plugin/'); + return `${id.replace('dayjs/plugin/', 'dayjs/esm/plugin/')}/index.js`; return id; } },