On the toplevel we have:
.
: OurBigBook package- Every require outside of
web/
must be relative, except for executables such as ourbigbook or demos such as lib_hello.js, or else the deployment will break.This is because we don't know of a super clean way of adding the toplevelourbigbook
package to the search path asnpm run link
does not work well on Heroku.A known workaround to allownpm run build-assets
is done at: web/build.sh.
Currently, Heroku deployment does the following:
- install both
dependencies
anddevDependencies
npm run build
- remove
devDependencies
from the final output to save space and speed some things upThedevDependencies
should therefore only contain things which are needed for the build, typically asset compressors like Webpack, but not components that are required at runtime.
This setup creates some conflict between what we want for OurBigBook command line users, and Heroku deployment.
Notably, OurBigBook command line users will want SQLite, and Heroku never, and SQLite installation is quite slow.
Since we were unable to find any way to make things more flexible on the
package.json
with some kind of optional depenency, for now we are just hacking out any dependencies that we don't want Heroku to install at all from package.json and web/package.json with sed
rom heroku-prebuild.Further discussion at: github.com/ourbigbook/ourbigbook/issues/156