-
Notifications
You must be signed in to change notification settings - Fork 24
Description
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 🙂)