Skip to content

Commit

Permalink
add bundle property to package for targets that produce webpack bundl…
Browse files Browse the repository at this point in the history
…es (#113)
  • Loading branch information
hborawski authored Dec 21, 2022
1 parent 5cfe21c commit b56b5b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def javascript_pipeline(

resolved_entry = entry if entry else _find_entry(root_dir, srcs)

# If library_name is defined, the package is being bundled and we should
# generate an entry in the package.json to point to the bundle file
additional_properties = ("{\"bundle\": \"./dist/%s.prod.js\"}" % name.split('/')[1]) if library_name else None

js_library_pipeline(
name = name,
srcs = srcs,
Expand All @@ -119,6 +123,7 @@ def javascript_pipeline(
out_dir = out_dir,
create_package_json_opts = {
"base_package_json": "//tools:pkg_json_template",
"additional_properties": additional_properties
}
)

Expand Down

0 comments on commit b56b5b1

Please sign in to comment.