rules_js icon indicating copy to clipboard operation
rules_js copied to clipboard

Example of "differential loading"

Open alexeagle opened this issue 2 years ago • 1 comments

Translate this example https://github.com/bazelbuild/rules_nodejs/tree/stable/examples/webapp to rules_js which shows how to create an ESM and ES5 bundle and serve the right one to modern browsers.

alexeagle avatar Jun 13 '22 15:06 alexeagle

Started this here: https://github.com/aspect-build/bazel-examples/tree/diff_loading

failing with

ERROR: /Users/alexeagle/Projects/bazel-examples/web_differential_loading/BUILD.bazel:3:21: in directory_path rule //:app_chunks_es5__entry_point:
Traceback (most recent call last):
	File "/private/var/tmp/_bazel_alexeagle/4c631830123360fff233a1c36bdbc895/external/aspect_bazel_lib/lib/private/directory_path.bzl", line 17, column 13, in _directory_path
		fail("expected directory to be a TreeArtifact (ctx.actions.declare_directory) but got {}".format(ctx.file.directory))
Error in fail: expected directory to be a TreeArtifact (ctx.actions.declare_directory) but got <source file node_modules/@babel/cli/store/7.17.10_@[email protected]/dir>

alexeagle avatar Jun 13 '22 15:06 alexeagle