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 toplevelourbigbookpackage to the search path asnpm run linkdoes not work well on Heroku.A known workaround to allownpm run build-assetsis done at: web/build.sh.
Currently, Heroku deployment does the following:
- install both
dependenciesanddevDependencies npm run build- remove
devDependenciesfrom the final output to save space and speed some things upThedevDependenciesshould 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