-
Notifications
You must be signed in to change notification settings - Fork 470
Generated code requires modules from bs-platform, forcing an extra production dependancy #2082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@lpil do you run npm on GCP? If not, can you run a script remove all those binary files which is not needed for production |
Removing the binaries after the fact is possible but less ideal as I'll need to install them in the first place, which is slow and means I have to ensure the postinstall script runs in an excitment that is outside of my control. It'd be really great if the output directory could be copy-pasted to anywhere and feel confident that it will run so long as there is a working Node JS installation :) Thanks |
We're writing code in reason and deploying it to Google's Cloud Function platform (more specifically Firebase Cloud Functions). We ended up using rollup for bundling and moved bs-* deps to |
@arnihermann this is what I've done in the past with aws-lambda |
Is there a way to do this while preserving stack traces so that it lists the original file location rather than somewhere in one large file? |
I don't know of one for node. But rather than bundling, you could always just zip up what you want to send on CI and use that as the deployable artefact (including node_modules). |
closed as a duplication of #2127 |
Hello!
My compiled bucklescript code imports modules from
bs-platform
such asbs-platform/lib/js/pervasives.js
. I'm not using a module bundler (making a node application), so I need to have these modules present on my production server.I don't wish to add
bs-platform
to my production deps because it's ~220MB and runs some postinstall scripts. I'm targeting GCP's FaaS so I'm unable to manually add these files to my productionnode_modules
.Currently I'm looking to manually copy these bs-platform files to my output directory and run a regex on this directory to modify the
require
paths, which is quite fiddly.For people like me writing node applications I think it would be nice to set a flag and have
bsb
write all the required Javascript modules (i.e.bs-platform/lib/js/pervasives.js
) to the output directory and then use relativerequire
paths.Thanks,
Louis
The text was updated successfully, but these errors were encountered: