Open divdavem opened 3 months ago
Can we have both scripts?
Folks with ignore-scripts=true would not have prepare ran, yeah?
@NullVoxPopuli Thank you for your comment.
Can we have both scripts?
prepare
and prepack
are both called before publishing to npm, so I don't see any benefit to have both.
Folks with ignore-scripts=true would not have prepare ran, yeah?
People with ignore-scripts=true
would see no change from the current setup with prepack
.
As prepare
is run before publishing to npm, the package published to npm would not have any difference.
There is a difference when installing the package with a git npm dependency (to use it directly from this github repository).
In that case, prepare
causes the devDependencies
to be installed before the prepare
script is run.
But that would probably not happen for people with ignore-scripts=true
(but it would not work either with prepack
).
This PR replaces the
prepack
script with theprepare
script, so that it is easy for any depending package to try any branch of any fork of thesignal-polyfill
repository with the git url or the github url syntax in thepackage.json
file. For example:As mentioned in npm documentation:
Without this change, the build process is not run automatically by npm and the installed package is not directly usable when referred through a git or github url dependency in
package.json
.Note that, even though, according to the npm documentation
prepack
is supposed to be called as well in this case (Runs BEFORE a tarball is packed (on "npm pack", "npm publish", and when installing a git dependency).
), in practice, I did not find thedist
folder when trying with theprepack
script instead ofprepare
.