On the toplevel we have:
.: OurBigBook package
web/: OurBigBook Web package that depends on the local OurBigBook package through relative path
..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 toplevel
ourbigbookpackage to the search path as
npm run linkdoes not work well on Heroku.A known workaround to allow
npm run build-assetsis done at: web/build.sh.
Currently, Heroku deployment does the following:
- install both
npm run build
devDependenciesfrom the final output to save space and speed some things upThe
devDependenciesshould 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