v2.2.0 Multi‑Format Build & CDN Fix#17
Merged
Rajesh-Royal merged 12 commits intomasterfrom Aug 11, 2025
Merged
Conversation
Remove extra "npm i"s.
- Updated package.json to include module and exports fields for better compatibility with ESM and CommonJS. - Added build scripts for generating type declarations and bundling the library in multiple formats (esm, cjs, iife). - Introduced tsup as a development dependency for efficient bundling. - Modified src/index.ts to expose getCurrentBrowserFingerPrint as a global function for UMD/IIFE builds, ensuring compatibility with classic script usage.
…les and multi-format builds
✅ Deploy Preview for broprintjs canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds multi-format build outputs (ESM
index.mjs, CJSindex.js, and global/IIFEindex.global.js), enabling direct browser usage via both<script type="module">and classic<script>tags. ExposesgetCurrentBrowserFingerPrintas a window global when loaded via the global build. Updates export map, adds tsup bundling, updates README with new CDN examples, and adds a changelog entry. Resolves inability to import the library from a CDN previously reported (window.getCurrentBrowserFingerPrint is not a functionand missing named export errors).Type of change
Checklist
npm run build)How to test
npm installnpm run buildlib/index.mjs,lib/index.js,lib/index.global.js,lib/index.d.tsnode -e "const { getCurrentBrowserFingerPrint } = require('./lib'); console.log(typeof getCurrentBrowserFingerPrint);"should printfunction.node --input-type=module -e "import { getCurrentBrowserFingerPrint } from './lib/index.mjs'; console.log(typeof getCurrentBrowserFingerPrint);"should printfunction.Screenshots / Logs
N/A – library build / API unchanged; packaging only.
Related issues
Fixes: CDN usage errors (unreported issue numbers) regarding missing named export and undefined global.
Additional context
devDependencies) for concise multi-target bundling.if (typeof window !== 'undefined' ...)).#7 #16