diff --git a/Dockerfile b/Dockerfile index dcccc01..a883368 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,16 @@ COPY package.json package-lock.json ./ # builds itself on install, which is what lets it be named by a git URL rather than fetched from a # package registry this mesh does not yet run. RUN npm install --no-audit --no-fund +# **And then compile the toolkit, because npm did not.** It declares a `prepare` script, which is +# the hook npm is supposed to run after installing a package from git — and this npm does not run +# it, so the package arrives as sources with every one of its entry points pointing at a compiled +# directory that is not there. The compile is therefore done here, explicitly: install the toolkit's +# own build dependencies inside it, build it, then drop them again so they do not travel into the +# image. Doing it by hand rather than relying on the hook is also the honest arrangement — a build +# that silently depended on a hook firing would break the day it stopped, in the same invisible way. +RUN npm --prefix node_modules/@novox/mesh-sdk install --no-audit --no-fund \ + && npm --prefix node_modules/@novox/mesh-sdk run build \ + && npm --prefix node_modules/@novox/mesh-sdk prune --omit=dev COPY tsconfig.json ./ COPY src ./src RUN npm run build