Heroku's official Cloud Native Buildpack for pnpm install
.
This buildpack will install and cache package.json
and pnpm-lock.json
dependencies using the pnpm install
command.
This buildpack relies on and builds on top of the
Node.js Engine Cloud Native Buildpack
to install Node.js and the
Node.js Corepack Cloud Native Buildpack
to install pnpm
.
- Sets up a cacheable content-addressable dependency store.
- Sets up a non-cacheable virtual dependency store.
- Modifies
pnpm config
so that the above content-addressable and virtual stores are used bypnpm install
- Downloads, stores, and hard links
package.json
andpnpm-lock.json
dependencies withpnpm install --frozen-lockfile
. - Runs
build
scripts from package.json, includingheroku-prebuild
,heroku-build
(orbuild
), andheroku-postbuild
. - Sets the default process type as
pnpm start
if it's defined inpackage.json
pnpm
versions 7+pnpm
hoist = true
modepnpm
hoist = false
modepnpm
Plug'n'Play mode.
- Optional
devDependencies
.devDependencies
are always installed. - Pruning
devDependencies
.devDependencies
are always installed. - Arbritrary
store-dir
orvirtual-store-dir
locations. This buildpack only supports it's own store locations.
This buildpack's bin/detect
will only pass if a pnpm-lock.json
exists in the
project root. This is done to prevent the buildpack from providing indeterminate
and unpredictable dependency trees.
This buildpack requires
node
(from the heroku/nodejs-engine buildpack)
and pnpm
(from the heroku/nodejs-corepack buildpack).
It also provides
and requires
and node_modules
.
The hoist = true
, hoist = false
, shamefully-hoist = false
,
shamefully-hoist = true
configurations are all supported by this buildpack.
To use any of these features, make the changes in the project's .npmrc
file.
Plug'n'Play is supported. Use node-linker = pnp
and symlink = false
in
the project's .npmrc
to enable this mode.
After dependencies are installed, build scripts will be run in this order:
heroku-prebuild
, heroku-build
(falling back to build
if heroku-build
does not exist), heroku-postbuild
.
If a start
script is detected in package.json
, the default process type
for the build will be set to pnpm start
.
This buildpack assumes that pnpm
was installed by another buildpack, like
heroku/nodejs-corepack. Check out
heroku/nodejs-corepack to learn about how it selects
versions.
To build an app locally into an OCI Image with this buildpack, use the pack
command from Cloud Native Buildpacks using
heroku/nodejs-engine,
heroku/nodejs-corepack, and this buildpack:
pack build example-app-image --buildpack heroku/nodejs-engine --buildpack heroku/nodejs-corepack --buildpack heroku/nodejs-pnpm-install --path /some/example-app
Alternatively, use the heroku/builder:22
builder, which includes the above
buildpacks:
pack build example-app-image --builder heroku/builder:22 --path /some/example-app
For development, dependencies, contribution, license and other info, please refer to the root README.md.