-
Notifications
You must be signed in to change notification settings - Fork 468
Make bsb able to compile all third-party artifacts into the top-level lib/ #2418
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
In addition to making Longer term, it would be beneficial to have |
I'd love to see this happen! I'll start experimenting with this in bsb-native this week. I'll tag you on the changes :) |
I'd love to see this happen! My use case: I'm building a node app (so no bundler like webpack). I have a Reason library as a dependency. When the library is compiled, its artifacts end up in I worked around this by making the deploy script responsible for installing |
Yarn is moving to an esy style cache of dependencies not located in node_modules and it appears that npm is also experimenting with this mechanism as well. In Yarn's model writing into node_modules is not an option either, so it looks like bsb should think about solving this soon. |
Yeah agreed |
it is okay to move .cm[ij] files into lib, but it is complex for js files |
This would also help with using bucklescript in projects built with yarn2nix where we link an immutable node_modules from the nix store 👍 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Don't close, this is still relevant for Yarn PnP and nix. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Folks might accidentally use
npm link
ornpm install local/path
and have npm symlink the dependency into their own project, either for testing or for whatever other purposes. This is a common scenario and because bsb places artifacts inside these symlinked dirs, some weird behaviors happen.I think it's reasonable to provide an option to ask bsb to output artifacts outside of the third-party dirs. Maybe in the top-level lib/js folder. Maybe we can pass it as a CLI flag while we're at it so that we don't need to care where to place the artifacts. This allows us to interop with other package managers and workflows better without too much cost.
It'd be a config from the top-level that overrides whatever the third-party bsconfig says.
cc @bsansouci who needed this
Edit: the flag approach might be better, e.g.
bsb -artifacts-location foo/bar
(is ninja ok with this?). We might need flags soon anyway if we want to have a dev vs prod mode (for e.g. printing debugging?)The text was updated successfully, but these errors were encountered: