Commit b44d413
committed
build: use npm prepare instead of prepublishOnly
In NPM, the `prepublishOnly` script is run only before running
`npm publish`. However, this means that people trying to use the git
version of of this project
(i.e. with `npm install ferdikoomen/openapi-typescript-codegen`)
won't get a working version of this project, since there will be
nothing in the `dist/` folder.
[NPM (since v4.0.0)][1] supports a `prepack` script, that is called:
> * Runs BEFORE the package is packed
> * Runs BEFORE the package is published
> * Runs on local `npm install` without any arguments
> * Run AFTER `prepublish`, but BEFORE `prepublishOnly`
> * NOTE: If a package being installed through git contains a `prepare`
> script, its `dependencies` and `devDependencies` will be installed,
> and the prepare script will be run, before the package is packaged
> and installed.
[1]: https://docs.npmjs.com/cli/v6/using-npm/scripts#life-cycle-scripts1 parent 6c75c80 commit b44d413
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments