paketo-buildpacks / npm-start

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Reloadable Process Types

thitch97 opened this issue · comments

Background

Per the Reloadable Process Types RFC, we want to integrate the watchexec buildpack with npm-start to enable live reloading on k8s.

Acceptance Criteria

When BP_LIVE_RELOAD_ENABLED is set to true:

  • The buildpack should require watchexec at launch and,

  • set a start command for the container which uses watchexec to invoke the command that the buildpack would otherwise have set.

  • The watchexec start command should be configured such that it restarts the
    given process whenever files in the workspace are changed.

  • The watchexec start command should be configured such that it ignores changes
    to package.json, package-lock.json & node_modules/ so that Yarn processes which
    modify dependency management files or web frameworks which modify the
    node_modules cache on-the-fly (e.g. React, Vue) do not trigger a restart.