Skip to content

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

Description

@aleksaelezovic

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 🙂)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or requestinvalidThis doesn't seem right

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions