Link Search Menu Expand Document

prepublish

  • can be used to transpile and minify your code and to fetch “remote resources that your package will use”

prepublishOnly

prepare

prepare: Run both

- BEFORE the package is packed and published
    - on local npm install without any arguments
    - and when installing git dependencies 
- This is run AFTER prepublish, but BEFORE prepublishOnly.

History

  • Since npm@1.1.71, the npm CLI has run the prepublish script for both npm publish and npm install, because it’s a convenient way to prepare a package for use (some common use cases are described in the section below). It has also turned out to be, in practice, very confusing. As of npm@4.0.0, a new event has been introduced, prepare, that preserves this existing behavior

Copyright © 2020 Thence LLC