From 7e998b0509ed035f02256c9e639e49c726d2658d Mon Sep 17 00:00:00 2001 From: Amrendra Vikram Singh <76041208+AmrendraTheCoder@users.noreply.github.com> Date: Sat, 15 Aug 2026 03:52:23 +0530 Subject: [PATCH 1/2] fix(pkg): make the package importable from ESM and CommonJS The published package could not be consumed from either module system. package.json declares "type": "module", so every .js file in src/ is treated as an ES module. The only export machinery in src/social-share-button.js is a guarded `module.exports` block, and in an ES module `module` is undefined, so that block never runs. There is no `export` statement in the file either, so the module ends up with zero exports. Only the `window.SocialShareButton` assignment survives, which is why the CDN script tag path worked and the npm path did not. src/social-share-analytics.js had the same latent problem. The code in src/ is already written as CommonJS and is free of import and export syntax. Rather than add `export` to those files, which would make them a SyntaxError when loaded through the documented