-
Notifications
You must be signed in to change notification settings - Fork 523
Description
I am building a project that runs on both nodejs and in the browser. I need to use different implementations of a ts_library depending on the runtime environment.
This seems like a good fit for Bazel's platform concept, (in combination with ts_library's module_name
argument), but I'm having trouble figuring out how to properly model this scenario.
Tools like webpack and rollup can be configured to look in the "browser"
field of package.json to find an entry-point appropriate for the browser. I'd like to be able to accomplish the same in Bazel with rules_nodejs.
This project's README.md implies this should be possible but I can't find any guidance in the rest of the documentation on how to do it properly:
The nodejs rules integrate NodeJS development toolchain and runtime with Bazel.
This toolchain can be used to build applications that target a browser runtime ...
I've looked through the Bazel Platforms Cookbook but haven't seen anything there that would fit the bill.