Skip to content

Commit a864f80

Browse files
Max Blackowlstronaut
authored andcommitted
docs: document gypfile field in package.json
1 parent 2fc689d commit a864f80

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/lib/content/configuring-npm/package-json.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,20 @@ The key is the lifecycle event, and the value is the command to run at that poin
534534

535535
See [`scripts`](/using-npm/scripts) to find out more about writing package scripts.
536536

537+
### gypfile
538+
539+
If you have a binding.gyp file in the root of your package and you have not defined your own `install` or `preinstall` scripts, npm will default to building your module using node-gyp.
540+
541+
To prevent npm from automatically building your module with node-gyp, set `gypfile` to `false`:
542+
543+
```json
544+
{
545+
"gypfile": false
546+
}
547+
```
548+
549+
This is useful for packages that include native addons but want to handle the build process differently, or packages that have a binding.gyp file but should not be built as a native addon.
550+
537551
### config
538552

539553
A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades.

0 commit comments

Comments
 (0)