dkg.js icon indicating copy to clipboard operation
dkg.js copied to clipboard

Rollup CJS issue on different OS/arch, when dkg.js is a dependency in lockfile

Open aleksaelezovic opened this issue 9 months ago • 0 comments

Building the project for commonjs compatibility is currently happening postinstall using npx rollup ... (See package.json file)

Issue with this approach: if a user installs the dkg.js as a dependency in a node.js project on one operating system (creating the package-lock.json lockfile) - the lockfile will contain the rollup version for that specific OS, requiring the user on another machine with different OS/architecture to delete lockfile prior to running npm install

Suggestion: it should be done during prepack or prepublishOnly instead, on the machine that is building and publishing a new dkg.js version. This way it can be done using just rollup ... instead of npx rollup ... (npx was needed because rollup is a dev dependency) Also this approach makes more sense anyway. https://docs.npmjs.com/cli/v11/using-npm/scripts#life-cycle-scripts

Requires publishing a new version as well.

NOTE: Suggested solution was not tested NOTE: Don't check the git blame, it was me (I rushed it for V8 🙂)

aleksaelezovic avatar Jul 14 '25 14:07 aleksaelezovic